Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TP_Solar_System
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hugo.marty
TP_Solar_System
Commits
75bddb69
Commit
75bddb69
authored
1 year ago
by
hugo.marty
Browse files
Options
Downloads
Patches
Plain Diff
fix(main.c): Correction de l'affichage des commandes
parent
8f7a068c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
program/main
+0
-0
0 additions, 0 deletions
program/main
program/main.c
+47
-21
47 additions, 21 deletions
program/main.c
program/main.o
+0
-0
0 additions, 0 deletions
program/main.o
with
47 additions
and
21 deletions
program/main
+
0
−
0
View file @
75bddb69
No preview for this file type
This diff is collapsed.
Click to expand it.
program/main.c
+
47
−
21
View file @
75bddb69
...
@@ -20,44 +20,70 @@ int main()
...
@@ -20,44 +20,70 @@ int main()
bool
active_random_planet
=
false
;
bool
active_random_planet
=
false
;
bool
active_fictive_planet
=
false
;
bool
active_fictive_planet
=
false
;
// Demander à l'utilisateur si il veut activer la création des planètes fictives
printf
(
"Voulez vous activer les planètes fictives ? (y/n)
\n
"
);
char
answer2
;
command_return
=
scanf
(
"%c"
,
&
answer2
);
if
(
command_return
&&
answer2
==
'y'
)
{
active_fictive_planet
=
true
;
}
// Clear la console
command_return
=
system
(
"clear"
);
// Afficher le titre
printf
(
"Bienvenue dans le simulateur de système planétaire
\n
"
);
// Vidé le buffer de scanf
while
((
command_return
=
getchar
())
!=
'\n'
&&
command_return
!=
EOF
)
{}
// Demander à l'utilisateur si il veut activer la fonctionnalité d'ajout de planète aléatoire
// Demander à l'utilisateur si il veut activer la fonctionnalité d'ajout de planète aléatoire
printf
(
"Voulez vous activer la fonctionalité d'ajout de planète aléatoire ? (y/n)
\n
"
);
printf
(
"Voulez vous activer la fonctionalité d'ajout de planète aléatoire ? (y/n)
\n
"
);
printf
(
"Attention, la fonctionalité impactera le système initial
e
\n
"
);
printf
(
"Attention, la fonctionalité impactera le système initial
\n
"
);
char
answer
;
char
answer
;
command_return
=
scanf
(
"%c"
,
&
answer
);
command_return
=
scanf
(
"%c"
,
&
answer
);
if
(
command_return
&&
answer
==
'y'
)
if
(
command_return
&&
answer
==
'y'
)
{
{
active_random_planet
=
true
;
active_random_planet
=
true
;
printf
(
"Fonctionalité activée
\n
"
);
}
// Clear la console
command_return
=
system
(
"clear"
);
// Afficher à l'utilisateurs les commandes
printf
(
"COMMANDES
\n
"
);
printf
(
"Echap : Quitter
\n
"
);
printf
(
"Flèche gauche : Zoomer
\n
"
);
printf
(
"Flèche droite : Dézoomer
\n
"
);
printf
(
"Flèche haut : Augmenter la vitesse de simulation
\n
"
);
printf
(
"Flèche bas : Diminuer la vitesse de simulation
\n
"
);
if
(
active_random_planet
)
{
printf
(
"Espace : Ajouter une planète aléatoire
\n
"
);
printf
(
"Espace : Ajouter une planète aléatoire
\n
"
);
}
}
if
(
active_random_planet
||
active_fictive_planet
)
{
printf
(
"------
\n
"
);
}
if
(
active_random_planet
)
{
printf
(
"Planètes aléatoire activée
\n
"
);
}
else
else
{
{
printf
(
"
Fonctionalité
désactivée
\n
"
);
printf
(
"
Planètes aléatoire
désactivée
\n
"
);
}
}
// Demander à l'utilisateur si il veut activer la création des planètes fictives
// Vidé le buffer de scanf
if
(
active_fictive_planet
)
while
((
command_return
=
getchar
())
!=
'\n'
&&
command_return
!=
EOF
)
{}
printf
(
"Voulez vous activer les planètes fictives ? (y/n)
\n
"
);
char
answer2
;
command_return
=
scanf
(
"%c"
,
&
answer2
);
if
(
command_return
&&
answer2
==
'y'
)
{
{
active_fictive_planet
=
true
;
printf
(
"Planètes fictives activée
\n
"
);
printf
(
"Fonctionalité activée
\n
"
);
}
}
else
else
{
{
printf
(
"
Fonctionalité
désactivée
\n
"
);
printf
(
"
Planètes fictives
désactivée
\n
"
);
}
}
// Afficher à l'utilisateurs les commandes
printf
(
"Commandes :
\n
"
);
printf
(
"Echap : Quitter
\n
"
);
printf
(
"Flèche gauche : Zoomer
\n
"
);
printf
(
"Flèche droite : Dézoomer
\n
"
);
printf
(
"Flèche haut : Augmenter la vitesse de simulation
\n
"
);
printf
(
"Flèche bas : Diminuer la vitesse de simulation
\n
"
);
// Initialisation de la fenêtre
// Initialisation de la fenêtre
srand
(
time
(
NULL
));
srand
(
time
(
NULL
));
...
...
This diff is collapsed.
Click to expand it.
program/main.o
+
0
−
0
View file @
75bddb69
No preview for this file type
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