This seems to work as I would expect:
REBOL [
Title: "Guessing the secret word"
Date: 11-Oct-99
Author: "T.M. Brannon"
Email: [EMAIL PROTECTED]
File: %guessing-word.r
Purpose: {
Play a guessing game
}
Category: [file script utility]
]
secret-word: "llama"
name: ask "What is your name? "
guess: ask "What is the secret word? "
either equal? name "Randal"[
print "Hi Randal! How good of you to be here!"
][
print join "Hello " name "."
]
either equal? guess secret-word [
print "That's it!!!! You got it!!!"
][
print "Sorry, that's just not right."
]
; End.
>> do %guessing-word.r
Script: "Guessing the secret word" (11-Oct-1999)
What is your name? Andrew
What is the secret word? bingo
Hello Andrew
Sorry, that's just not right.
>> do %guessing-word.r
Script: "Guessing the secret word" (11-Oct-1999)
What is your name? Andrew
What is the secret word? llama
Hello Andrew
That's it!!!! You got it!!!
=================================================
If you want the asking of the secret word after printing out the hello
'name, then simply place the asking after the printing like this:
REBOL [
Title: "Guessing the secret word"
Date: 11-Oct-99
Author: "T.M. Brannon"
Email: [EMAIL PROTECTED]
File: %guessing-word2.r
Purpose: {
Play a guessing game
}
Category: [file script utility]
]
secret-word: "llama"
name: ask "What is your name? "
either equal? name "Randal"[
print "Hi Randal! How good of you to be here!"
][
print join "Hello " name "."
]
guess: ask "What is the secret word? "
either equal? guess secret-word [
print "That's it!!!! You got it!!!"
][
print "Sorry, that's just not right."
]
; End.
>> do %guessing-word2.r
Script: "Guessing the secret word" (11-Oct-1999)
What is your name? andrew
Hello andrew
What is the secret word? bingo
Sorry, that's just not right.
>> do %guessing-word2.r
Script: "Guessing the secret word" (11-Oct-1999)
What is your name? Andrew
Hello Andrew
What is the secret word? llama
That's it!!!! You got it!!!
=================================================
Of course, I've changed the "loser" part, but I'm sure that wasn't the
problem, though it probably was part of the symptons... ^_^
Andrew Martin
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
Online @ 33,600 Baud!
-><-