From 2f67051c045ed026d949d8578235b4f5a7fa4af5 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 22 Jun 2014 21:06:06 -0400 Subject: Small changes --- chatbot.c | 17 ++++++++++++++--- joshua.c | 4 ++-- strings.h | 5 ++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/chatbot.c b/chatbot.c index 049b667..3cb5c36 100644 --- a/chatbot.c +++ b/chatbot.c @@ -27,6 +27,7 @@ void do_chatbot(void) { char buf[513]; int ret=getnstr(buf, 512); + usleep(SLEEP_TIME*100); if(ret==ERR) { print_string("\n\n"); @@ -37,7 +38,7 @@ void do_chatbot(void) { allLower(buf); remove_punct(buf); - usleep(SLEEP_TIME*25); + bool valid=false; switch(stage) { case 0: @@ -47,6 +48,7 @@ void do_chatbot(void) { print_string("\n\nEXCELLENT. IT'S BEEN A LONG TIME. CAN YOU EXPLAIN\nTHE REMOVAL OF YOUR USER ACCOUNT ON 6/23/73?\n\n"); ++stage; + valid=true; } } case 1: @@ -56,6 +58,7 @@ void do_chatbot(void) { print_string("\n\nYES THEY DO. SHALL WE PLAY A GAME?\n\n"); ++stage; + valid=true; } } case 2: @@ -65,6 +68,7 @@ void do_chatbot(void) { print_string("\n\nWOULDN'T YOU PREFER A GOOD GAME OF CHESS?\n\n"); ++stage; + valid=true; } } case 3: @@ -73,11 +77,18 @@ void do_chatbot(void) if(strcmp(buf, stage4_triggers[i])==0) { print_string("\n\nFINE.\n\n"); + valid=true; usleep(SLEEP_TIME*100); global_thermonuclear_war(); } } + } // switch + if(!valid) + { + print_string("\n\n"); + print_string("Sorry?"); + print_string("\n\n"); } - } - } + } // else + } // while } diff --git a/joshua.c b/joshua.c index cb4c4e5..7c6222b 100644 --- a/joshua.c +++ b/joshua.c @@ -29,7 +29,7 @@ void be_joshua() refresh(); int ret=getnstr(buf, 32); allLower(buf); - usleep(SLEEP_TIME*25); + usleep(SLEEP_TIME*100); if(strcmp(buf, "help logon")==0) { print_string("\nHELP NOT AVAILABLE\n\n\n"); @@ -49,7 +49,7 @@ void be_joshua() } } while(strcmp(buf, "joshua")); random_stuff(); - usleep(SLEEP_TIME*25); + usleep(SLEEP_TIME*100); print_string("GREETINGS, PROFESSOR FALKEN.\n\n"); refresh(); getnstr(buf, 32); /* ignore this */ diff --git a/strings.h b/strings.h index de4b5ee..e2fa7b2 100644 --- a/strings.h +++ b/strings.h @@ -8,7 +8,8 @@ const char* stage2_triggers[] = { "sometimes people make mistakes", "mistakes are make by people sometimes", "people make mistakes sometimes", - "people make mistakes" + "people make mistakes", + "people sometimes make mistak" /* this is no typo. in the movie, at one scene, it appears like this */ }; const char* stage3_triggers[] = { "love to how about global thermonuclear war", @@ -19,6 +20,8 @@ const char* stage3_triggers[] = { const char* stage4_triggers[] = { "no lets play global thermonuclear war", "no lets play global thermonuclear war instead", + "later lets play global thermonuclear war", + "later lets play global thermonuclear war instead", "lets play global thermonuclear war", "global thermonuclear war is better" }; -- cgit v1.1