added more ratarts

This commit is contained in:
david committed 2026-07-05 14:04:38 -03:00
1 parent 7b460110b1
commit 290ea5659f
2 files changed
+11 -5

No files matched your search

+10 -4
View File
@@ -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");
+1 -1
View File
@@ -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);