-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
30 lines (21 loc) · 677 Bytes
/
main.c
File metadata and controls
30 lines (21 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// This is the driver file for a simulated Tortoise vs Hare race.
#include <stdio.h>
#include <ctype.h>
#include "simulation.h"
int main (void) {
// Declare Variable
char playGame;
// Prompt user to begin a race
printf("\n\nWould you like to watch a race? (Y/N)\n");
scanf(" %c", &playGame);
// Initiate a race and prompt the user to watch another
while (toupper(playGame) == 'Y') {
playGame = ' ';
// Begin race
runOneGame();
// Prompt user to race again
printf("\n\nWould you like to watch another race? (Y/N)\n");
scanf(" %c", &playGame);
}
return 0;
}