Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet l2
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
VAUTRIN Guillaume
Projet l2
Commits
2bc83552
Commit
2bc83552
authored
4 years ago
by
VUILLEMARD Juliette
Browse files
Options
Downloads
Patches
Plain Diff
Correction taleau des scores
parent
dce29f52
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
score.c
+7
-7
7 additions, 7 deletions
score.c
with
7 additions
and
7 deletions
score.c
+
7
−
7
View file @
2bc83552
...
...
@@ -12,13 +12,13 @@
int
score
;
//tableau des scores
int
tabBestScores
[
10
]
=
{
0
};
int
tabBestScores
[
10
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
//Fonctions sur le tableau des scores :
//si le joueur veut effacer les meilleurs scores
void
initTabBestScores
(
int
tab
[
10
]){
for
(
i
=
0
;
i
=
10
;
i
++
){
for
(
int
i
=
0
;
i
<=
9
;
i
++
){
tab
[
i
]
=
0
;
}
}
...
...
@@ -27,7 +27,7 @@ void initTabBestScores(int tab[10]){
//à appeler à chaque fin de partie
void
nouveauScore
(
score
){
if
(
score
>
tabBestScores
[
9
]){
for
(
i
=
8
;
i
=
0
;
i
--
){
for
(
int
i
=
8
;
i
>
=
0
;
i
--
){
if
(
score
>
tabBestScores
[
i
]){
tabBestScores
[
i
+
1
]
=
tabBestScores
[
i
];
//on décale vers le bas du classement
}
...
...
@@ -46,8 +46,8 @@ void EcritScore(int lignesFichier[]){ //écrit une nouvelle ligne de le fichier
FILE
*
fichier
=
NULL
;
fichier
=
fopen
(
"score.txt"
,
"w"
);
if
((
fichier
=
fopen
(
"score.txt"
,
"w"
))
==
NULL
){
printf
(
"Le fichier score.txt n'existe pas.
\n
"
)
if
((
fichier
==
NULL
){
printf
(
"Le fichier score.txt n'existe pas.
\n
"
)
;
}
else
{
for
(
i
=
0
;
i
<=
9
;
i
++
){
...
...
@@ -62,8 +62,8 @@ void LitScore(int score[]){ //lit le fichier des scores
char
lignesFichier
[
10
]
=
"0"
;
FILE
*
fichier
=
NULL
;
fichier
=
fopen
(
"score.txt"
,
r
);
if
((
fichier
=
fopen
(
"score.txt"
,
r
))
==
NULL
){
fichier
=
fopen
(
"score.txt"
,
"r"
);
if
((
fichier
==
NULL
){
printf
(
"Le fichier score.txt n'existe pas."
);
}
else
{
...
...
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