diff options
Diffstat (limited to 'games')
| -rw-r--r-- | games/gamecatch.c | 8 | ||||
| -rw-r--r-- | games/gameguess.c | 28 |
2 files changed, 36 insertions, 0 deletions
diff --git a/games/gamecatch.c b/games/gamecatch.c new file mode 100644 index 0000000..eb8c6c9 --- /dev/null +++ b/games/gamecatch.c @@ -0,0 +1,8 @@ +#include <stdio.h> +#include <stdlib.h> +#include "../rat.h" +void gamecatch(){ + + printf("67"); + +} diff --git a/games/gameguess.c b/games/gameguess.c new file mode 100644 index 0000000..ad6c9be --- /dev/null +++ b/games/gameguess.c @@ -0,0 +1,28 @@ +#include <stdio.h> +#include <stdlib.h> +#include "../rat.h" + +void gameguess(){ +int guess; +int solved = 0; +int range = 100; + +int correct = (rand() % (range + 1)); + +printf("let's play a game, squeak!~ you gues a number between 0 and %d!\n", range); + + +while(solved != 1){ + +scanf("%d", &guess); + +if(guess < correct){ +printf("number too low try again\n"); +}else if(guess > correct){ +printf("number too high try again\n"); +}else {printf("yes!! correct! squeaaakk!~\n"); solved = 1;} +} + + addstat(&rat.fun); + +} |
