Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"]
- alias hangman [
- tmp_word = (at $words (rnd (listlen $words)))
- echo Welcome to hACkman, ACs very own version of the classic word game "hangman."
- echo ""
- echo The word is (listlen $tmp_word) characters long, please make your first guess by using the /try command...
- alias found []
- alias junk []
- alias tries 7
- ]
- hangman
- alias try [
- tmp_msg = []
- if (strstr $junk $arg1) [
- echo You already tried (concatword $arg1 ,) please try again...
- ]
- if (! (strstr $tmp_word $arg1)) [
- -= tries 1
- echo Sorry, but $arg1 was not found in the word. You now have $tries incorrect guesses left...
- ]
- loop q (listlen $tmp_word) [
- if (strstr $found (at $tmp_word $q)) [
- loop r (listlen $found) [
- if (strcmp (at $tmp_word $q) (at $found $r)) [tmp_msg = (concatword $tmp_msg (at $found $r))]
- ]
- ] [
- if (strcmp (at $tmp_word $q) $arg1) [
- tmp_msg = (concatword $tmp_msg $arg1)
- add2list found $arg1
- echo $arg1 was found in the word, congratulations! You have $tries incorrect guesses left. Please try again...
- ] [
- tmp_msg = (concatword $tmp_msg _)
- ]
- ]
- ]
- 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] [
- if (strstr $junk $arg1) [] [add2list junk $arg1]
- echo $tmp_msg
- if (! (strstr $tmp_msg _)) [echo Congratulations you won! Use the /hangman command to start a fresh round...]
- ]
- ]
Advertisement
Add Comment
Please, Sign In to add comment