diff options
| author | david <[email protected]> | 2026-04-30 15:02:42 -0300 |
|---|---|---|
| committer | david <[email protected]> | 2026-04-30 15:05:13 -0300 |
| commit | be9c7f9280a2e9b50c9386c72a020b115e24a927 (patch) | |
| tree | 39b01fe632844ad88f89e38f26f5ca9d1ee04cca /games | |
| parent | 2d61b43a7250401674bc44c7960851ec33dbcf33 (diff) | |
| download | petratc-be9c7f9280a2e9b50c9386c72a020b115e24a927.tar.gz petratc-be9c7f9280a2e9b50c9386c72a020b115e24a927.zip | |
moved files around
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); + +} |
