From be9c7f9280a2e9b50c9386c72a020b115e24a927 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 30 Apr 2026 15:02:42 -0300 Subject: moved files around --- games/gamecatch.c | 8 ++++++++ games/gameguess.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 games/gamecatch.c create mode 100644 games/gameguess.c (limited to 'games') 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 +#include +#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 +#include +#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); + +} -- cgit v1.3-2-g0d8e