mirror of
https://git.squeakyrat.moe/petratc/
synced 2026-11-04 18:35:43 +01:00
fixed stupid things happening if you're stupid
This commit is contained in:
1 parent
112351f9bc
commit
f161c1e4a9
3 files changed
+13
-9
No files matched your search
@@ -109,12 +109,15 @@ int truing = 1;
|
||||
|
||||
while(truing){
|
||||
printf("1: play a game! (fun up), 4: take a shower! (clean up), 9: print me!, 0: exit...\n");
|
||||
scanf("%d", &choice);
|
||||
|
||||
if(scanf("%d", &choice) != 1){
|
||||
while(getchar() != '\n'); //flush the bad input if you're a bad boy and put q instead of 1
|
||||
continue;
|
||||
}
|
||||
switch(choice){
|
||||
|
||||
case 1: gameguess(); break;
|
||||
case 4: gamecatch(); break;
|
||||
case 8: printf("%d\n", rat.age); break;
|
||||
case 9: printrat(); break;
|
||||
case 0: truing = 0; break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user