From 290ea5659f2555d920a6077f078e1c60746b049a Mon Sep 17 00:00:00 2001 From: david Date: Sun, 5 Jul 2026 14:04:38 -0300 Subject: [PATCH] added more ratarts --- petratc.c | 14 ++++++++++---- rat.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/petratc.c b/petratc.c index f2f8c34..e21bf43 100644 --- a/petratc.c +++ b/petratc.c @@ -15,8 +15,13 @@ #define ratsave "%s/.local/share/rat/rat.txt" #endif - char ratart[] = - " .---.\n (\\./) \\.......-\n >' '< (__.'\"\"\"\"\"\"\n \" ` \" \"_"; + char *ratart[] = { + " .---.\n (\\./) \\.......-\n >' '< (__.'\"\"\"\"\"\"\n \" ` \" \"_", + " .---.\n-......./ (\\./)\n \"\"\"\"\"\"'.__) >' '<\n _\" \" ` \"", + " .---.\n (\\./) \\.......-\n >= =< (__.'\"\"\"\"\"\"\n \" ` \" \"_", + " .---.\n (\\./) \\.......-\n >0 0< (__.'\"\"\"\"\"\"\n \" ` \" \"_", + " .---.\n (\\./) \\.......-\n >^ ^< (__.'\"\"\"\"\"\"\n \" ` \" \"_", + }; char *messages[] = { "squeak!", @@ -93,10 +98,11 @@ void printrat(WINDOW *win){ werase(win); box(win, 0, 0); - + + int ratties = (sizeof(ratart)/sizeof(ratart[0])); int row = 1; char artcopy[256]; - strncpy(artcopy, ratart, sizeof(artcopy)); + strncpy(artcopy, ratart[rand() % ratties], sizeof(artcopy)); artcopy[sizeof(artcopy)-1] = '\0'; char *line = strtok(artcopy, "\n"); diff --git a/rat.h b/rat.h index b826e74..c35bb51 100644 --- a/rat.h +++ b/rat.h @@ -10,7 +10,7 @@ typedef struct { int age; } Rat; -extern char ratart[]; +extern char *ratart[]; extern char *messages[]; extern Rat rat; void addstat(float *guy);