Ver Fonte

Made more dynamic phrases

  Added 3 different kinds of wolf howls to phrases,
  Added sizeof code so random number to pick the phrase will use the
length of phrases.
david há 4 anos atrás
pai
commit
dee7cd89c3
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      mystic.c

+ 3 - 3
mystic.c

@@ -422,7 +422,7 @@ void render(int fd, const char *string_out) {
   }
 }
 
-// Beanzilla'a no repeats
+// Beanzilla's no repeats
 
 /**
  * have_seen( list, len, item )
@@ -479,14 +479,14 @@ void harry_event(int fd) {
   int r;
   // This is no where near finished, BUT!
   const char *phrases[] = {"Hahaha", "Snicker, snicker", "Boo!", "MeOW",
-                           "I see U"};
+                           "I see U", "Arrooo!", "Ahh-wooo!", "Aaaooo!"};
   const char *cp;
 
   // Remember the last phrase used,
   // and don't repeat (the last two)!
 
   do {
-    r = random() % 5;
+    r = random() % ( (sizeof(phrases) / sizeof(char *)) - 1 );;
   } while (have_seen(last_seen_harry_event, MAX_HARRY_EVENT_DUPS, r));
 
   ZF_LOGD("%d => %d %d", r, last_seen_harry_event[0], last_seen_harry_event[1]);