aboutsummaryrefslogtreecommitdiff
path: root/petratc.c
diff options
context:
space:
mode:
authordavid <[email protected]>2026-04-30 15:02:42 -0300
committerdavid <[email protected]>2026-04-30 15:05:13 -0300
commitbe9c7f9280a2e9b50c9386c72a020b115e24a927 (patch)
tree39b01fe632844ad88f89e38f26f5ca9d1ee04cca /petratc.c
parent2d61b43a7250401674bc44c7960851ec33dbcf33 (diff)
downloadpetratc-be9c7f9280a2e9b50c9386c72a020b115e24a927.tar.gz
petratc-be9c7f9280a2e9b50c9386c72a020b115e24a927.zip
moved files around
Diffstat (limited to 'petratc.c')
-rw-r--r--petratc.c67
1 files changed, 24 insertions, 43 deletions
diff --git a/petratc.c b/petratc.c
index 0d6308e..5334e7b 100644
--- a/petratc.c
+++ b/petratc.c
@@ -3,6 +3,7 @@
#include <time.h>
#include <sys/stat.h>
#include "rat.h"
+#include "defs.h"
#ifdef __APPLE__
#define ratpath "%s/Library/Application Support/rat"
@@ -12,6 +13,28 @@
#define ratsave "%s/.local/share/rat/rat.txt"
#endif
+ char ratart[] =
+ " .---.\n (\\./) \\.......-\n >' '< (__.'\"\"\"\"\"\"\n \" ` \" \"_";
+
+ char *messages[] = {
+ "squeak!",
+ "squeak! !",
+ "squeak",
+ "squeak...",
+ "SQUEAK",
+ "SQUEAK!!",
+ "SQUEAAAKKKKK",
+ };
+
+void addstat(float *guy){
+
+ if(*guy < 98.5){
+ *guy += 1.5;
+ } else{*guy += 0.05;}
+}
+
+Rat rat;
+
void save(void) {
char path[256];
snprintf(path, sizeof(path), ratpath, getenv("HOME"));
@@ -63,13 +86,6 @@ void setstat(){
rat.age = timenow; //thinking about this makes my cortisol spike so i'll just ignore it even more
}
-//stupid function but it's smart if you think about it. just ignore it
-void addstat(float *guy){
-
- if(*guy < 98.5){
- *guy += 1.5;
- } else{*guy += 0.05;}
-}
void printrat(){
@@ -81,41 +97,6 @@ void printrat(){
}
-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);
-
-}
-
-void showergame(){
-
-//ignore this i'm working on it
-
-
-
- addstat(&rat.clean);
-}
-
-
int main(){
srand(time(NULL));
@@ -132,7 +113,7 @@ int truing = 1;
switch(choice){
case 1: gameguess(); break;
- case 4: showergame(); break;
+ case 4: gamecatch(); break;
case 8: printf("%d\n", rat.age); break;
case 9: printrat(); break;
case 0: truing = 0; break;