Bukz

Stupid hangman script concept... :D

Mar 15th, 2011
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.68 KB | None | 0 0
  1. alias words ["a s s a u l t" "c a p t u r e" "c u b e r s" "d e s e r t" "h a n g m a n"]
  2. alias hangman [
  3.   tmp_word = (at $words (rnd (listlen $words)))
  4.   echo Welcome to hACkman, ACs very own version of the classic word game "hangman."
  5.   echo ""
  6.   echo The word is (listlen $tmp_word) characters long, please make your first guess by using the /try command...
  7.   alias found []
  8.   alias junk []
  9.   alias tries 7
  10. ]
  11. hangman
  12. alias try [
  13.   tmp_msg = []
  14.   if (strstr $junk $arg1) [
  15.     echo You already tried (concatword $arg1 ,) please try again...
  16.   ]
  17.   if (! (strstr $tmp_word $arg1)) [
  18.     -= tries 1
  19.     echo Sorry, but $arg1 was not found in the word. You now have $tries incorrect guesses left...
  20.   ]
  21.   loop q (listlen $tmp_word) [
  22.     if (strstr $found (at $tmp_word $q)) [
  23.       loop r (listlen $found) [
  24.         if (strcmp (at $tmp_word $q) (at $found $r)) [tmp_msg = (concatword $tmp_msg (at $found $r))]
  25.       ]
  26.     ] [
  27.       if (strcmp (at $tmp_word $q) $arg1) [
  28.         tmp_msg = (concatword $tmp_msg $arg1)
  29.         add2list found $arg1
  30.         echo $arg1 was found in the word, congratulations! You have $tries incorrect guesses left. Please try again...
  31.       ] [
  32.         tmp_msg = (concatword $tmp_msg _)
  33.       ]
  34.     ]
  35.   ]
  36.   if (< $tries 1) [echo Sorry, but you ran out of incorrect guesses, you lose! Use the /hangman command to start a fresh round...; tmp_msg = []; loop t (listlen $tmp_word) [tmp_msg = (concatword $tmp_msg (at $tmp_word $t))]; echo The word was: $tmp_msg] [
  37.     if (strstr $junk $arg1) [] [add2list junk $arg1]
  38.     echo $tmp_msg
  39.     if (! (strstr $tmp_msg _)) [echo Congratulations you won! Use the /hangman command to start a fresh round...]
  40.   ]
  41. ]
Advertisement
Add Comment
Please, Sign In to add comment