RosettaCodeData/Task/Magic-8-ball/FreeBASIC/magic-8-ball.basic

17 lines
799 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
dim as string answer(0 to 19) = { "It is certain.", "It is decidedly so.", "Without a doubt.", "Yes definitely.",_
"You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.",_
"Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.",_
"Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.",_
"My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful." }
dim as string question
randomize timer
print "Q to quit."
do
input "What would you like to know? ", question
if ucase(question)="Q" then exit do
print answer(int(rnd*20))
print
loop