Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Labyrinthe-Perdu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Gambirasio
Labyrinthe-Perdu
Commits
ac0fcc3b
Commit
ac0fcc3b
authored
1 year ago
by
HydroFlo
Browse files
Options
Downloads
Patches
Plain Diff
controle de saisie pour enlever le readInt
parent
baffcf05
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
S1.02/Jeu/classes/Labyrinthe.class
+0
-0
0 additions, 0 deletions
S1.02/Jeu/classes/Labyrinthe.class
S1.02/Jeu/src/Labyrinthe.java
+36
-1
36 additions, 1 deletion
S1.02/Jeu/src/Labyrinthe.java
with
36 additions
and
1 deletion
S1.02/Jeu/classes/Labyrinthe.class
+
0
−
0
View file @
ac0fcc3b
No preview for this file type
This diff is collapsed.
Click to expand it.
S1.02/Jeu/src/Labyrinthe.java
+
36
−
1
View file @
ac0fcc3b
...
@@ -567,6 +567,29 @@ class Labyrinthe extends Program{
...
@@ -567,6 +567,29 @@ class Labyrinthe extends Program{
assertFalse
(
equals
(
tab1
,
tab4
));
assertFalse
(
equals
(
tab1
,
tab4
));
}
}
boolean
estInt
(
String
verif
){
if
(
length
(
verif
)
==
0
){
return
false
;
}
for
(
int
i
=
0
;
i
<
length
(
verif
);
i
++){
if
(
charAt
(
verif
,
i
)
<
'0'
||
'9'
<
charAt
(
verif
,
i
)){
return
false
;
}
}
return
true
;
}
void
testEstInt
(){
String
mot1
=
"0t6"
;
String
mot2
=
"54"
;
String
mot3
=
"Lolilol"
;
String
mot4
=
""
;
assertFalse
(
estInt
(
mot1
));
assertTrue
(
estInt
(
mot2
));
assertFalse
(
estInt
(
mot3
));
assertFalse
(
estInt
(
mot4
));
}
void
algorithm
(){
void
algorithm
(){
Salle
[][]
lab
=
genererLab
(
3
);
//genere le Layrinthe
Salle
[][]
lab
=
genererLab
(
3
);
//genere le Layrinthe
String
[][]
questionTemp
=
load
(
"ressources/ListeQuestion.csv"
);
String
[][]
questionTemp
=
load
(
"ressources/ListeQuestion.csv"
);
...
@@ -574,7 +597,19 @@ class Labyrinthe extends Program{
...
@@ -574,7 +597,19 @@ class Labyrinthe extends Program{
boolean
ques
=
equals
(
toLowerCase
(
readString
()),
"o"
);
boolean
ques
=
equals
(
toLowerCase
(
readString
()),
"o"
);
if
(
ques
){
if
(
ques
){
print
(
"Combien voulez vous en ajouter ? : "
);
print
(
"Combien voulez vous en ajouter ? : "
);
int
nbAjout
=
readInt
();
int
nbAjout
=
0
;
while
(
nbAjout
<=
0
){
String
nb
=
readString
();
while
(!
estInt
(
nb
)){
print
(
"Veuillez entrer un nombre valide : "
);
nb
=
readString
();
}
nbAjout
=
stringToInt
(
nb
);
if
(
nbAjout
<=
0
){
print
(
"Veuillez choisir un nombre positif non nul : "
);
}
}
ajoutQuestion
(
questionTemp
,
nbAjout
);
ajoutQuestion
(
questionTemp
,
nbAjout
);
questionTemp
=
load
(
"ressources/ListeQuestion.csv"
);
questionTemp
=
load
(
"ressources/ListeQuestion.csv"
);
afficheStringTab
(
questionTemp
);
afficheStringTab
(
questionTemp
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment