Not logged in

Differences From Artifact [2af14c6a07221fb4]:

File hangman/hangman.retro part of check-in [8eafc4e897] - Use strings' (hangman) by crc on 2010-09-13 18:43:47. [annotate] [view]

To Artifact [4d27dce6ecc86ed4]:

File hangman/hangman.retro part of check-in [24efd34450] - fix hangman game to work with latest image by crc on 2010-09-15 18:23:26. [annotate] [view]


@@ -62,17 +62,17 @@
 : guessChar ( c- )  guessed @ target @ rot toGuess ;
 
 ( --[ Printing ]---------------------------------------------- )
 
-: .target   ( - )  target @ type ;
-: .guessed  ( - )  guessed @ type ;
-: .input    ( - )  ." Tries: ( " lifeline @ . ." ): " ;
-: .fouls    ( - )  ." Fouls: " foul-addr type ;
+: .target   ( - )  target @ print ;
+: .guessed  ( - )  guessed @ print ;
+: .input    ( - )  "Tries: ( " print lifeline @ . "): " print ;
+: .fouls    ( - )  "Fouls: " print foul-addr print ;
 : .prompt   ( - )  0 0 at-xy .guessed cr .fouls cr .input ;
-: .already  ( - )  ."  [already guessed]" ;
-: .correct  ( - )  ."  [correct guess]  " ;
+: .already  ( - )  space "[already guessed]" print ;
+: .correct  ( - )  space "[correct guess]  " print ;
 : .graphic  ( - )  lives lifeline @ - 1- graphics + @ do ;
-: .wrong    ( - )  ."  [not present]    " .graphic ;
+: .wrong    ( - )  space "[not present]    " print .graphic ;
 
 ( --[ Guessing ]---------------------------------------------- )
 
 : 0<>   (  x-f ) 0 = not ;
@@ -101,19 +101,19 @@
 : remaining ( -f )  guessed @ '_ has ;
 : alive     ( -f )  remaining lifeline @ 0<> and ;
 : dead      ( -f )  alive not ;
 : foot      (  - )  0 20 at-xy ;
-: .lose     (  - )  foot ." You LOSE; the word was: " .target ;
-: .win      (  - )  foot .target cr ." You WIN!" ;
+: .lose     (  - )  foot "You LOSE; the word was: " print .target ;
+: .win      (  - )  foot .target cr "You WIN!" print ;
 : endgame   (  - )  lifeline @ if .win else .lose then ;
 : (hangman) (  - )  clear repeat dead if endgame ;then guess again ;
 : hangman   ( $- )  >target revive (hangman) ;
 
 ( --[ Main Game ]--------------------------------------------- )
 
 : y-or-n    ( -f )  key dup 'y = swap 'Y = or ;
-: .again?   ( -f )  cr cr ." Play again? [Y/N] " y-or-n ;
+: .again?   ( -f )  cr cr "Play again? [Y/N] " print y-or-n ;
 : play      ( -  )
   initialise dict @ 0; drop
   repeat get-word hangman .again? 0 =if close-dict bye then again ;
 ( ============================================================ )
 play