Differences From Artifact [7a72740e81e7c83c]:
File hangman/hangman.retro part of check-in [e5f0ff793e] - fix hangman game by crc on 2010-11-16 18:09:33. [annotate] [view]
To Artifact [59dc0c43aa0dbebb]:
File hangman/hangman.retro part of check-in [f07b468712] - start using ^ rather than open the full vocabulary (hangman) by crc on 2010-11-16 18:20:14. [annotate] [view]
@@ -11,10 +11,8 @@ include graphics.retro include dict.retro -with strings' - ( --[ Macros ]------------------------------------------------ ) : 2push ` push ` push ; compile-only : 2pop ` pop ` pop ; compile-only @@ -59,9 +57,9 @@ : .target ( - ) @target puts ; : .guessed ( - ) @guessed puts ; : .input ( - ) @lifeline "Tries: (%d): " puts ; : .fouls ( - ) "Fouls: " puts foul-addr puts ; -: .prompt ( - ) 0 0 at-xy .guessed cr .fouls cr .input ; +: .prompt ( - ) 0 0 ^console'at-xy .guessed cr .fouls cr .input ; : .already ( - ) space "[already guessed]" puts ; : .correct ( - ) space "[correct guess] " puts ; : .graphic ( - ) lives lifeline @ - 1- graphics + @ do ; : .wrong ( - ) space "[not present] " puts .graphic ; @@ -93,9 +91,9 @@ : revive ( - ) lives lifeline ! 0fouls ; : remaining ( -f ) guessed @ '_ has ; : alive ( -f ) remaining lifeline @ 0<> and ; : dead ( -f ) alive not ; -: foot ( - ) 0 20 at-xy ; +: foot ( - ) 0 20 ^console'at-xy ; : .lose ( - ) foot "You LOSE; the word was: " puts .target ; : .win ( - ) foot .target cr "You WIN!" puts ; : endgame ( - ) lifeline @ if .win else .lose then ; : (hangman) ( - ) clear repeat dead if endgame ;then guess again ;