Magic 8-ball: Difference between revisions

From Rosetta Code
Content added Content deleted
(Created page with "{{Magic 8-Ball} =={{header|Ring}}== <lang ring> # Project : Magic 8-Ball # Date : 2018/04/24 # Author : Gal Zsolt (~ CalmoSoft ~) # Email : <calmosoft@gmail.com> answer...")
 
No edit summary
Line 1: Line 1:
{{Magic 8-Ball}
{{Magic 8-Ball}}


=={{header|Ring}}==
=={{header|Ring}}==

Revision as of 04:45, 24 April 2018

Template:Magic 8-Ball

Ring

<lang ring>

  1. Project : Magic 8-Ball
  2. Date  : 2018/04/24
  3. Author : Gal Zsolt (~ CalmoSoft ~)
  4. Email  : <calmosoft@gmail.com>

answers = ["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", "Signs point to yes", "Yes",
                "Reply hazy, try again", "Ask again later",
                "Better not tell you now", "Cannot predict now",
                "Concentrate and ask again", "Don't bet on it",
                "My reply is no", "My sources say no", "Outlook not so good",
                "Very doubtful"]  

index = random(len(answers)) if index != 0

  see answers[index] + nl

ok </lang> Output:

It is certain