Handbook
Glossary
play-wordlet ( game -- )
Vocabulary
wordlet
Inputs
game
an
object
Outputs
None
Definition
USING:
accessors
colors
combinators
io
kernel
sequences
;
IN:
wordlet
:
play-wordlet
( game -- )
dup
maybe-stop?
[
COLOR:
red
print-secret
]
[
{
[
print-guesses
]
[
print-remaining-chars
]
[
[
read-guess
]
dip
guesses>>
push
]
[
dup
guesses>>
last
[
dup
check-winner?
[
COLOR:
green
print-secret
]
[
play-wordlet
]
if
]
[
"you gave up, the word was "
write
COLOR:
red
print-secret
]
if
]
}
cleave
]
if
;