Hi, I managed to get list iteration to work with my cycle-words3 word, but I
would like to get it to work with the cleaner-looking cycle-words. Any help
is appreciated.

REBOL [
    Title:  "More than one secret word (sequential cycle)"
    Date:   11-Oct-99
    Author: "T.M. Brannon"
    Email:  [EMAIL PROTECTED]
    File:   %more-than-one-word-2.r
    Purpose:    {
        Play a guessing game
    }
    Category: [file script utility]
]


secret-words: [ "camel" "llama" "oyster" ]
cycle-words: func [] [either tail? secret-words
  [ head secret-words ]
  [ pick next secret-words 1]]
cycle-words2: either tail? secret-words
  [ head secret-words ]
  [ pick next secret-words 1]
index: 0
cycle-words3: [ either equal? index length? secret-words
  [  index: 1         ]
  [  index: index + 1 ]
       pick secret-words index ]

name:  ask "What is your name? "
guess: func [] [ask "What is the secret word? "]

either equal? name "Randal"
 [ print "Hi Randal! No secret word required. You're the greatest!" ]
 [ print ["Hello" name "." ]
   while [not equal? guess do cycle-words3]
  [ print "Wrong loser." ]
        print "That's it!!!! You got it!!!" ]


Reply via email to