Test yourself…

Write the program. If you are careful, it should run the first time!

/* CON EXEC */

/* Tossing a coin. The machine is lucky, not the user */

do forever
say "Let's play a game! Type 'Heads', 'Tails'",
"or 'Quit' and press ENTER."
pull answer

select
when answer = "HEADS"
then say "Sorry! It was TAILS. Hard luck!"
when answer = "TAILS"
then say "Sorry! It was HEADS. Hard luck!"
when answer = "QUIT"
then exit
otherwise
say "That's not a valid answer. Try again!"
end
say
end


rvse054.html | Timestamp icon Last updated: Monday, 5 June 2017