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
05887965
Commit
05887965
authored
1 year ago
by
HydroFlo
Browse files
Options
Downloads
Patches
Plain Diff
avance de plus de 1 par 1
parent
06a56617
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
S1.02/Jeu/classes/Labyrinthe.class
+0
-0
0 additions, 0 deletions
S1.02/Jeu/classes/Labyrinthe.class
S1.02/Jeu/ressources/score.csv
+1
-1
1 addition, 1 deletion
S1.02/Jeu/ressources/score.csv
S1.02/Jeu/src/Labyrinthe.java
+18
-10
18 additions, 10 deletions
S1.02/Jeu/src/Labyrinthe.java
with
19 additions
and
11 deletions
S1.02/Jeu/classes/Labyrinthe.class
+
0
−
0
View file @
05887965
No preview for this file type
This diff is collapsed.
Click to expand it.
S1.02/Jeu/ressources/score.csv
+
1
−
1
View file @
05887965
...
...
@@ -3,5 +3,5 @@ Hydro,38
Alex,37
Bob,37
Testeur,34
Test,32
Cheh,31
Lose,30
This diff is collapsed.
Click to expand it.
S1.02/Jeu/src/Labyrinthe.java
+
18
−
10
View file @
05887965
...
...
@@ -80,12 +80,12 @@ class Labyrinthe extends Program{
return
res
;
}
char
controleSaisie
(){
// verifie que l'utilisateur saisisse bien 1 caractere
String
controleSaisie
(){
// verifie que l'utilisateur saisisse bien 1 caractere
String
choix
;
do
{
choix
=
toLowerCase
(
readString
());
}
while
(
length
(
choix
)!=
1
);
return
ch
arAt
(
choix
,
0
)
;
}
while
(
length
(
choix
)
!=
1
&&
length
(
choix
)
!=
2
);
return
ch
oix
;
}
char
[][]
genererSalle
(
String
cheminFichier
){
// génère une grille d'une du labyrinthe d'après un fichier (taille 72x19)
...
...
@@ -444,14 +444,14 @@ class Labyrinthe extends Program{
boolean
fait
=
false
;
newFile
[
0
][
0
]
=
file
[
0
][
0
];
newFile
[
0
][
1
]
=
file
[
0
][
1
];
for
(
int
i1
=
1
;
i1
<
length
(
f
ile
,
1
);
i1
++){
//copie le fichier de base
if
(
score
>=
stringToInt
(
file
[
i
1
][
1
])
&&
!
fait
){
//ajoute le score du joueur a la place qu'il mérite (en cas d'égalité remplace l'ancien ;) )
for
(
int
i1
=
1
;
i1
<
length
(
newF
ile
,
1
);
i1
++){
//copie le fichier de base
if
(
score
>=
stringToInt
(
file
[
i
][
1
])
&&
!
fait
){
//ajoute le score du joueur a la place qu'il mérite (en cas d'égalité remplace l'ancien ;) )
newFile
[
i1
][
0
]
=
pseudo
;
newFile
[
i1
][
1
]
=
""
+
score
;
fait
=
true
;
}
else
{
//sinon remet les ancienne ligne
for
(
int
j1
=
0
;
j1
<
length
(
file
,
2
);
j1
++){
newFile
[
i
][
j1
]
=
file
[
i
][
j1
];
newFile
[
i
1
][
j1
]
=
file
[
i
][
j1
];
}
i
=
i
+
1
;
//incrémente i pour savoir quelle ligne de l'ancien fichier ont été mise dans le nouveau
}
...
...
@@ -675,8 +675,18 @@ class Labyrinthe extends Program{
afficheLab
(
salle
);
println
(
""
+
joueur
.
pseudo
+
" / Score : "
+
joueur
.
score
+
" / PV : "
+
joueur
.
vie
);
int
[]
indiceP
=
indiceDe
(
'P'
,
salle
);
char
choix
=
controleSaisie
();
indiceP
=
deplacement
(
salle
,
choix
,
indiceP
[
0
],
indiceP
[
1
],
joueur
,
lQuestion
,
lQuestionBoss
,
indiceSalle
);
String
choix
=
controleSaisie
();
int
nbMove
=
1
;
if
(
length
(
choix
)
==
2
){
nbMove
=
charToInt
(
charAt
(
choix
,
1
));
}
for
(
int
i
=
0
;
i
<
nbMove
;
i
++){
indiceP
=
deplacement
(
salle
,
charAt
(
choix
,
0
),
indiceP
[
0
],
indiceP
[
1
],
joueur
,
lQuestion
,
lQuestionBoss
,
indiceSalle
);
delay
(
100
);
println
(
nbMove
);
println
(
i
);
afficheLab
(
salle
);
}
if
(!
equals
(
indiceSalleActu
,
indiceSalle
)){
salle
=
genererSalle
(
"ressources/Lab/Salle"
+
lab
[
indiceSalle
[
0
]][
indiceSalle
[
1
]].
numero
);
salle
[
indiceP
[
0
]][
indiceP
[
1
]]
=
'P'
;
...
...
@@ -689,8 +699,6 @@ class Labyrinthe extends Program{
rando
=
(
int
)
(
random
()
*
3
)
+
1
;
}
}
}
if
(
joueur
.
bossVaincu
){
print
(
readFile
(
"ressources/img/Win.txt"
,
true
));
...
...
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