This is the sensible and incorrect answer.
Brannon wrote:
> 1: my cycle-words definition works until I attempt to move back to
the front of the sequence... thus I need some sort of fix to the first
clause of my cycle-words defn
I would suggest:
found? find secret-words guess
is a better solution to your problem.
> 2: I think it is un-necessarily redundant to recode the binding of
guess to the output of an ask, but, reform appears to fail in this
respect. Can anyone help optimize away that guess: ask "What is the
secret word?" in the body of the while loop?
> name: ask "What is your name? "
> guess: ask "What is the secret word? "
>
> either equal? name "Randal"
> [ print "Hi Randal! No secret word required. You're the greatest!" ]
> [ print [ join "Hello " name "." ]
> while [not equal? reform guess do cycle-words]
> [ print rejoin [ guess " is not a correct guess." ]
> guess: ask "What is the secret word? " ]
> print "That's it!!!! You got it!!!" ]
How about:
secret-words: ["camel" "llama" "oyster"]
name: ask "What is your name? "
print join "Hi, " [name "."]
either equal? name "Randal" [
print "No secret word required. You're the greatest!"
][
while [not found? find secret-words secret-word: ask "What is the
secret word? "] [
print join {Sorry, but ^"} [secret-word {" was not one of the secret
words.}]
]
print "That's it! You got it!"
]
Andrew Martin
Who's feeling in a quantum mood today...
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
Online @ 33,600 Baud!
-><-