# Create a Magic 8 Ball

As a child, my friend had a magic 8 ball that we would ask questions to and see what the fate of that question was.

# Challenge

Your challenge is to write a program (or function) that when run (or called), outputs (or returns) a random answer from the possible answers below. (Random being: each output should have a nonzero chance of occurring but they do not need to meet any other criteria)

The possible answers from the Magic 8-ball are (case-insensitive):

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
Yep
Signs point to yes
Better not tell you now
Cannot predict now
Don't count on it
My sources say no
Outlook not so good
Very doubtful

No input.

# Output

A random choice from above. Case does not matter.

# Rules

Standard loopholes are not allowed.

This is , so the shortest code in bytes for each language wins!

• I changed "no input allowed" to "no input", some languages require blank/null arguments as inputs. – Rɪᴋᴇʀ Mar 7 '18 at 21:21
• Is it me or someone is downvoting every answers?????? – Dat Mar 7 '18 at 21:33
• @Dat I posted something here in meta to discuss this. I have upvoted every answer, as I always do for answers that fulfil the requirements on my questions. Maybe a moderator will intervene... – DevelopingDeveloper Mar 7 '18 at 21:42
• @Dat Signs point to yes – mbomb007 Mar 7 '18 at 22:10
• @mbomb007 My favorite comment I have seen on PPCG thus far! – DevelopingDeveloper Mar 7 '18 at 22:20

# SOGL V0.12, 166 bytes

,▓a⁰²z○½℮ķčλ─fj[Ycψ-⁸jΔkÆΞu±⁄│(┼∞׀±q- υ~‼U/[DΓ▓νg⁸⅝╝┘¤δα~0-⁄⅝v⁄N⁷⁽╤oο[]āŗ=§№αU5$┌wΨgΘ°σΖ$d¦ƨ4Z∞▒²÷βΗ◄⁴Γ■!≤,A╬╤╬χpLΧ⁸⁽aIΘād⁵█↔‚\¶σΞlh³Ζ╤2rJ╚↓○sēχΘRψΙ±ιΗ@:┌Γ1⁷‘Ƨ! ΘlΨιw

Try it Here!

\o/ every word was in SOGLs dictionary!

• This is an awesome answer!!! – DevelopingDeveloper Mar 7 '18 at 22:24
• I'd love to take a look at SOGL's compression engine, but unfortunately, I don't speak JavaScript :( – caird coinheringaahing Mar 7 '18 at 22:46
• Wait, SOGL is a JavaScript-based language? – Shaggy Mar 7 '18 at 23:52
• @cairdcoinheringaahing SOGL is written in Processing, and the relevant compression files are here and here. Though Processing is a Java-based language :p – dzaima Mar 8 '18 at 5:49

# ><>, 438 bytes

x|o<"Yep"
x|^"Most likely"
x|^"Signs point to yes"
x|^"As I see it, yes"
x|^"Without a doubt"
x|^"Don't count on it"
x|^"Cannot predict now"
x|^"Very doubtful"
x|^"My sources say no"
x|^"Outlook not so good"
x|^"Better not tell you now"
x|^"It's certain"
x|^"Outlook good"
x|^"Yes definitely"
x|^"You may rely on it"
x|^"It is decidedly so"

Try it online!

Not that interesting, but I think it's the first answer where the randomness is not uniform. I put all the negative messages as least likely :)

### Some explanation:

The pointer starts going right at the first line. x changes the pointer to a random cardinal direction. If it goes up or down, it just encounters a different x. If it goes right, it bounces off the | and hits the same x. If it goes left, it wraps around and pushes that line's text to the stack. Most lines then hit the same track of ^ which changes the direction to upwards. This loops over the o on the first line, which outputs the stack until empty. The special case is the Yep line, which has the horizontal loop |o< instead.

• I will use this one. It (almost) always gives a positive response. Unfortunately the answer also smells fishy... – Suppen Mar 8 '18 at 15:07

# Python 2, 369 368 bytes

print"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.Yep.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".split('.')[id(0)/7%20]

# Python 3, 371 bytes

print("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.Yep.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".split('.')[hash(id)%20])

I was previously using the hash builtin to index (hash(id)%20), which returns a random value per-start of the Python interpreter ever since https://bugs.python.org/issue13703. It's not random for the empty-string though (always 0), so need to use something else, the id builtin!

On second look, I could use id directly, but it seems to always produce even numbers. IIRC, id(object) in CPython just returns the memory location of object, so this makes sense. Maybe if I used Jython or IronPython, I could skip the divide-by-7. Anyways, hash(id) vs id(0)//7 is equal in Python 3, but can use the / operator for truncating integer division in Python 2, saving a byte.

# PowerShell, 354 bytes

"It is certain0It is decidedly so0Without a doubt0Yes definitely0You may rely on it0As I see it, yes0Most likely0Outlook good0Yep0Signs point to yes0Reply hazy try again0Ask again later0Better not tell you now0Cannot predict now0Concentrate and ask again0Don't count on it0My reply is no0My sources say no0Outlook not so good0Very doubtful"-split0|Random

Try it online!

Ho-hum. Takes all the outcomes, concatenated together with 0s, then -splits on 0 to create an array of strings. Passes that array to Get-Random which will randomly select one of them. That's left on the pipeline and output is implicit.

# Python 2, 385 bytes

-1 byte thanks to ovs.

from random import*
print choice("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.Yep.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".split('.'))

Try it online!

• @Downvoter, may I ask why you've downvoted every answer? – totallyhuman Mar 7 '18 at 21:30
• That strikes me as suspicious voting behaviour, I'd suggest flagging the question for a mod's attention so they can investigate. – Shaggy Mar 7 '18 at 23:54

# Applescript, 391

I love how AppleScript's lists have a some item method:

{"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","Yep","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"}'s some item
• Cue the mean-spirited downvoter-of-all-answers in 3, 2, 1... Go on - I dare you to reveal who you are and explain your downvote rationale. Or will you continue to anonymously lurk in the shadows? – Digital Trauma Mar 8 '18 at 0:56

# Bash + GNU utilities, 230

• 15 bytes saved thanks to @Dennis.
sed 1d $0|zcat|shuf -n1 # zopflied 8 ball list The binary zopfli output is not well represented here; instead you can reconstruct the script from base64 encoded data: base64 -d << EOF > 8ball.sh c2VkIDFkICQwfHpjYXR8c2h1ZiAtbjEKH4sIAAAAAAACAz1QSZJCMQjd5xRv1fOlMEGlzIdfgbRF n75NOayYeYMExFF5BImWe9W4SuPWE27lKnG2GSA0m4coyWvhKCrBPUvaxEaJcStgColCDoEzQ+IH t/WymQe6XNa+zehmF5zMWknei8tJHbuJBsKw9gfvPXGmv0SMBJ0WNfLLPUOn4FEOHMEDaoHg3rGI qF1LJV29fXCTGveWaWWNQcEgbXi9Ks30PVBtauBOfkvc4cWhtkq3OSo7nBJqLwELxO2u45dH3u05 zv4= EOF Note, as allowed by the question, the compressed data decompresses to all lower case. This makes zopfli compression a bit more efficient and saves 16 bytes. • tail +2 doesn't work for me, but sed 1d$0 saves a byte anyway. Also, since output to STDERR is allowed by default, I don't think you need the exit. Also, the last ten bytes of the program can be removed. – Dennis Mar 8 '18 at 0:15
• @Dennis thanks! Extra output to STDERR always makes me feel a little uncomfortable, but I guess I should run with it. – Digital Trauma Mar 8 '18 at 0:40

# R, 360 bytes

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
Yep
Signs point to yes
Better not tell you now
Cannot predict now
Don't count on it
My sources say no
Outlook not so good
Very doubtful

Try it online!

Not exactly the most elegant solution. R has a neat feature where stdin will redirect to the source file, so you can put (small) datasets into source code, saving bytes for string splitting or worse, constructing the vector itself (all those quotes add up in a hurry). Along with builtins for random sampling, this makes a short-ish answer.

# Charcoal, 203 184 bytes

‽⪪”}∨74Dυ3↖u➙Ｈ�↖vＩ⁻VＲ‹ψ#�Ii»ψPNξ⮌≔;≡8ν}¬Ｈ⁺ºº↖H⁴Ｋ⌕êτ｜⁼➙⟲W»″φ◨⟦(τ(jK“Ｎ\⍘“↷⊙ⅉvＴ>➙§⌊Ｆζ³⁻↔;ＴaÀ✳⁴≔67⍘i4¬⸿-A8⁻f7¡<⁰Zχ}ζ'¡¹→Oaε!ＯυP₂ïμ´MuＰ⁺Ｍ⮌1№-k¹№FvξＤü⊟ζⅉ⁰xW:Dε7ＴvM₂⊞θC⪪Ｒε⁰“Ｄ¡⸿⁰″A⊕λξ↥~Ｏ·PＥ&”¶

Try it online! Link is to verbose version of code. Edit: Saved 19 bytes by lowercasing everything. Explanation:

”...”     Compressed string of newline-delimited responses
⪪     ¶    Split on newlines
‽           Random element
Implicitly print

# Retina, 333331 321 bytes

0cert10decided2so¶with34a d3bt¶yes definitely¶y3 ma5re26as i see it, yes¶mos4likely7good¶yep¶signs poin4to yes¶rep2haz5tr5ag18ain later¶better 94tell y3 9w¶can94predic49w¶concentrate and 81don'4c3n46m5rep2is 9¶m5s3rces sa59794so good¶ver5d3btful
9
no
8
7
¶3tlook
6
on it¶
5
y
4
t
3
ou
2
ly
1
ain¶
0
it is
G?

Try it online! Edit: Saved 1 byte by compressing doubt and 1 byte by lowercasing everything so I could compress reply. Then saved 10 bytes by using @Leo's Retina Kolmogorov golfer on the lowercased text (which coincidentally is the number of bytes it saved on my 333-byte answer).

• 323 bytes by using my Retina 0.8 Kolmogorov golfer – Leo Mar 7 '18 at 22:46
• @Leo Note that Retina 0.8.2 is a different language – mbomb007 Mar 7 '18 at 22:57
• @mbomb007 I know, but for simple substitutions like these it has the same syntax as Retina 1.0. I was just pointing out that the Kolmogorov golfer was written for an older version of Retina but it is still usable in this case. – Leo Mar 7 '18 at 23:00

# Coconut, 380 bytes

from random import*
choice$("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.Yep.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".split('.')) Try it online! # T-SQL, 393 bytes SELECT TOP 1*FROM STRING_SPLIT('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-Yep-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','-')ORDER BY NEWID() The function STRING_SPLIT is only available in SQL 2016 and later. Best I could get for prior versions using VALUES('It is certain'),('It is decidedly so'),... was 464 characters. Formatted, just so you can see the working part: SELECT TOP 1 * FROM STRING_SPLIT('It is certain-It is decidedly so-...', '-') ORDER BY NEWID() NEWID() generates a new, pseudo-random GUID, so is a way to do a pseudo-random sort. # Jelly, 201 bytes -2 bytes thanks to Mr. Xcoder. -1 byte thanks to user202729. “æ⁽IẊ?⁽ʋṠ¶ÐƝKW¬ḃỴɓ⁾:Eṇ⁵ṾɱD×⁴2ṇỤðċỊ¥ḷƬị÷ṣÐṆⱮ$u²OŀṚƁȮ1⁼ṁ$bp⁾v]Ɠ-/NẓḲnỵdḳḋ½ȥṿ=kv¥ɓl[kR AḞ¶gḣḞiẊŒẊḳçȤ⁻Ɱʋx:ØṖ|zY=ṾḌẓY1Ḃ$50d⁹⁸ŀhʂƤṢM;ḢoƁṾ⁷-uṙu¡Ọ3ṣȮ@⁹ðẹȥXƭ⁸|ƬẋẆḢɠœxḳsĿƘ(0çỌ~A½YIEFU3Ọ=⁷ɗḷBḷİṄhṗgṡƊẏẏḄ#Ṙʋ$ʂȷĠ»ỴX Try it online! Damn, SOGL's compression is good. • 202 bytes – Mr. Xcoder Mar 7 '18 at 22:00 • 201 bytes. Just append the 2 last characters. – user202729 Mar 11 '18 at 16:30 • (I mean, append ỴX to the end of the code so it chooses randomly from one of them) – user202729 Mar 11 '18 at 16:36 # 05AB1E, 171 bytes “€•€ˆ‹ì€•€ˆŸíly€Ê„›€…¬³…Ü´Î€î€¿Ëœ€‰€•€œ I€È€•,…Ü‚¢îÙ®½‚¿ yepŸé…®€„…Ü…ƒ hazy‡Ü†îˆ¹†îŠ´…ç€–ˆœ€î€Ó€©notßä€Óäè€ƒˆ¹†î€·n'tš‹€‰€•€¯…ƒ€ˆ€¸€¯Žç…è€¸®½€–€Ê‚¿‚Ò¬³ful“#•8∞f{ʒβ®•6в£ðýΩ Try it online! Explanation “ ... “ pushes a string of all the required words. Some words are taken directly from the 05ab1e dictionary. Some are written out in plain ascii (like haze). Some are combined dictionary and ascii (like do+n't). Then the processing code is: # # split string on spaces to a list of words •8∞f{ʒβ®• # push the number 2293515117138698 6в # convert to a list of base-6 numbers # ([3,4,3,2,5,5,2,2,1,4,4,3,5,3,4,4,4,4,4,2]) £ # group the list into sublists of these sizes ðý # join on spaces Ω # pick one at random • Try it online! - 176 with bruteforce conversion. – Magic Octopus Urn Mar 13 '18 at 16:24 • @MagicOctopusUrn: I think it's 182 with , and ' added. – Emigna Mar 13 '18 at 17:40 • D'oh! Ah I see it, yes. By the way remove the input from your TIO, it's confusing a little. – Magic Octopus Urn Mar 13 '18 at 18:32 • @MagicOctopusUrn: Doh! Thanks. I wasn't aware I'd left that in there :P – Emigna Mar 13 '18 at 20:15 • 166: TIO. Thrice -1 from using new dictionary words ( ye, don, and ha), and -2 from sorting the list by word count and using delta compression. – Grimy Sep 11 at 13:00 # Ruby, 362 361 bytes puts"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.Yep.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".split(?.).sample Try it online! • 1 byte thanks to @benj2240 • You can shave off a byte with ?. instead of '.'. – benj2240 Mar 8 '18 at 21:54 • @benj2240 wow, I hadn't seen that before. Very cool. – BigRon Mar 19 '18 at 21:00 • I had to go digging for the documentation on that ? single character string literal – BigRon Mar 19 '18 at 21:12 # Python 3, 386 bytes from random import* lambda:choice("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;Yep;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".split(';')) # Perl, 366 print((split",","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,Yep,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")[rand 19]) • I found a bug. You can't use comma as a separator because 1 of the possible answers from the Magic 8-ball contains a comma: As I see it, yes. – g4v3 Mar 9 '18 at 16:56 • I'd suggest that you use a single digit as the separator. It would save 1 byte, as the quotes are no longer needed, but a space must still be added to separate the digit and split. – g4v3 Mar 9 '18 at 17:31 • Also, you can omit parenthesis for print and save 1 more byte. Just put a unary plus sign before the list: print((0..9)[5]) would become print+(0..9)[5]. – g4v3 Mar 9 '18 at 17:38 # 05AB1E, 208 217 bytes "don'".•W˜FζÃT¥„ò.1₁∍Y<Ì°5jýúž+ìmHSéÁ¬–xÈƒø‚ž}_Øviòª§l["]0â^)„2æδ∍G1∊EÌLÝ'îôΛβ;ƒĀαÏw L°gðÈγ³€wE‘fι¥¤šαrˆQŠë¢-º8Æ~ÁŠ∍δBx®(β™Žü6»ƶÙÐ~†«\%ÍŒΘ-´sÈƵJŸ₃H7Ó˜:Å∍₂èÑï∞—Râú'óвb…ÓUXʒǝ₄ÝrÒ₄¨÷äè¤“oθWÎλî~bj(Ri Þиe‘ãj]•", yes"J'x¡Ω Try it online! Pretty basic solution. The possible answers are concatenated with the character x (since it's not present in the answers) and then compressed (inside the ), 'x¡Ω split on x and pop a random choice. Thanks to @Emigna for pointing out that the alphabet compression doesn't like ' or , much. Fixed by surrouding the compressed string with don' and , yes. • Nice idea to split on a character not present. Unfortunately alphabet compression replaces , and ' with spaces, so the output for those 2 lines are wrong. – Emigna Mar 8 '18 at 10:34 • @Emigna Thanks a lot for pointing it out ! I'm wondering if a better fix doen't exist for this issue... I could have used other non-used characters in the answers but there are only two: q and x :-( – Kaldo Mar 8 '18 at 10:52 # PHP, 412385337 384 bytes <?php$a=explode(1,"It is certain1It is decidedly so1Without a doubt1Yes definitely1You may rely on it1As I see it, yes1Most likely1Outlook good1Yep1Signs point to yes1Reply hazy try again1Ask again later1Better not tell you now1Cannot predict now1Concentrate and ask again1Don't count on it1My reply is no1My sources say no1Outlook not so good1Very doubtful");echo$a[array_rand($a)];

Try it online!

Fairly straight forward solution. Split the string by a delimiter(in this case 1) and choose a random element from the array.

• Welcome to PPCG! I've made some minor formatting changes to your post, and have a couple little suggestions - 1, you need to add a space after php to get your code to compile; 2, you can replace '|' with 1 and all | with 1 for -2 bytes; 3 should consider changing your link for Trying it Online to TIO.run as is preferred by the community. – Taylor Scott Mar 8 '18 at 12:26
• And here is a working version based off my feedback. Try it online! – Taylor Scott Mar 8 '18 at 12:28
• @TaylorScott It seems to be working fine on my enovironment without the space after the <?php tag. I'm running PHP 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 6 2018 11:18:25) ( NTS ). Not sure if in previous versions that matters or not. Either way, I've edited the question. – Andrew Mar 8 '18 at 12:32
• Ahh, it may just be the version - The link you provided uses PHP version 7.0.3, and it does not run on TIO.run without the space – Taylor Scott Mar 8 '18 at 12:39
• You could use <?= and echo the explode directly using [rand(0, 19)] instead of first adding to to a variable <?= explode("1", "str1str1str")[rand(0, 19)] – Jeroen Mar 9 '18 at 14:26

# Javascript, 372 bytes

-10 bytes thanks to Shaggy

_=>"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.Yep.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".split.[Math.random()*20|0]

Try it online!

• Use bitwise OR instead of Math.floor() to save 7 bytes: Math.random()*20|0. – Shaggy Mar 8 '18 at 11:04

# Befunge

1221 870 bytes (perimeter of the entire field is 33x36 30*29 charachters) Thanks to Jo King for helping me to remove the trailing nulls and urging me to change the randomizer.

"<"99+9+1+v
v         <
>>>>>>>>>>55++v
0123456789
>??????????<
0123456789
>>>>>>>>>>    v
>88++p       v
v"It is certain"
v"It is decidedly so"
v"Without a doubt"
v"Yes definitely"
v"You may rely on it"
v"As I see it, yes"
v"Most likely"
v"Outlook good"
v"Yep"
v"Signs point to yes"
v"Better not tell you now"
v"Cannot predict now"
v"Don't count on it"
v"My sources say no"
v"Outlook not so good"
v"Very doubtful"
>:#,_@

The top line puts the '<' character and the x-position (28) where it should go on the stack. Then we enter the sort of random number generator. This could be improved, but this is what I could deliver on short notice... The "random" number is offset to get the actual "random" line to read.

After the random number is generated, we put the '<' character at that line and push the letters on the stack and on the bottom line output them again.

Note; if you use the interpreter I linked to in this posts title you have to reclick the "Show" after each run, because the addition of the '<' character remains after execution.

• You're much better off using the same format as my ><> answer. Try it online!. As it is now, it also prints a bunch of null bytes at the end – Jo King Mar 8 '18 at 21:40
• Yeah, I know, I wanted the random number thingy not to be too biased, but I could've just used a single line of question marks. – rael_kid Mar 9 '18 at 6:53
• You can at least golf a couple of hundred bytes of whitespace off, and change the last line to >:#,_@ to avoid printing null bytes. Oh, and add a TIO link. – Jo King Mar 9 '18 at 8:10
• That's true, I'll post an update later today. – rael_kid Mar 9 '18 at 10:05

# Java 8 , 433, 392, 380, 379 bytes

a->"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~Yep~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".split("~")[(int)(Math.random()*20)]

Try it online!

• 41 bytes thanks to AdmBorkBork!
• 10 bytes thanks to Kevin!
• 1 byte thanks to Oliver!
• Surely you can use String.split() to save a bunch of bytes — docs.oracle.com/javase/7/docs/api/java/lang/… – AdmBorkBork Mar 7 '18 at 22:47
• As @AdmBorkBork stated, you can save 41 bytes using String#split. Also, you can save an additional 11 bytes using (int)(Math.random()*20) instead of new java.util.Random().nextInt(20). And the semi-colon isn't counted towards the byte-count for lambdas. So in total: 380 bytes. – Kevin Cruijssen Mar 8 '18 at 9:31
• There's an extra space in your answer and in @KevinCruijssen's golf: use Don't instead of Don' t. – Olivier Grégoire Mar 11 '18 at 20:24

# Red, 367 bytes

prin pick split{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.Yep.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}"."random 20

Try it online!

It doesn't seem really random in TIO (although it works just fine in the Red Console), that's why I added a random/seed to the header.

## Excel, 399 Bytes

=CHOOSE(1+20*RAND(),"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","Yep","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")

Since CHOOSE(X.Y,<>) is the same as CHOOSE(X,<>), no need for an INT

Not much golfing you can do here though...

# Aceto, 345 + 1 = 346 bytes (+1 for -l flag)

"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.Yep.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"'.:Yp

Try it online!

Not overly interesting, but I can't think of anything shorter in this language, no compressed strings or anything.

"...."   push strings separated by periods
'.  literal period
:  split on period
Y  shuffle stack
p  print top

• without the -l flag might look more interesting. – Laura Bostan Mar 9 '18 at 21:38
• @LauraBostan But I don't know hilbert curves past type 3 – drham Mar 9 '18 at 21:39
• and it's more bytes for all of the \n – drham Mar 9 '18 at 21:39
• But yes it would look more 'interesting' per se – drham Mar 9 '18 at 21:41
• iup... the -l flag was added for golfing. However, I am not very fond of it, steals cheaply the whole point of the language. Maybe next version of Aceto will give up this flag. – Laura Bostan Mar 9 '18 at 21:46

## C - 426 bytes

char a[][99]={"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","Yep","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"};int main(){int n;puts(a[n%20]);}

Uses an uninitialized variable mod 20 to index into an array of strings containing all possible outputs. Compilers complain that stdio.h isn't included, but it works OK. Probably because it just so happens to have the standard library linked in anyways. Lucky me.

• Worth noting on some implementations, an uninitialized variable has a value of 0, since the behavior is, well, undefined. Ask your magic 8-ball whether this is true on your machine. – Orion Mar 9 '18 at 8:40

# Go, 530 Bytes

package main;import"fmt";func main(){for k:=range map[string]struct{}{"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":{},"Yep":{},"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":{}}{fmt.Print(k);break}}

Please note that, on the Go Playground, because of how seeding works, it always gives the same result. When running on a regular computer, everything works as it should.
I think it is possible to save a bit more but my knowledge in Go stops there :)

Formatted and testable version

• Welcome to PPCG! The Go interpreter on Try It Online seems to use a random seed. – Dennis Mar 11 '18 at 14:30
• I must be terribly unlucky then D: – Nathanael C. Mar 11 '18 at 14:33
• Are you refreshing the page? That would fetch the result from cache every time, so it won't change. Clicking the Run button will run the code again. – Dennis Mar 11 '18 at 14:35
• I keep getting "It is certain" even after with a CTRL+R to hard refresh... I don't get it :x – Nathanael C. Mar 11 '18 at 15:08
• Refreshing won't change the result; they are cached on the server side. Click the run button (play icon in a circle) or press Ctrl-Enter. – Dennis Mar 11 '18 at 15:29

# Excel-VBA, 362341 339 Bytes

v=[1:1]:?v(1,Rnd*19)

Where A1:T1 contain the different options. Reads entire first row of sheet into array v and indexes a random point along the first 19 values.

Surprised to find that indexing an array doesn't require integer values

• My concerns about your answer for Excel are even more so here, as the Worksheet is counted as a STDIN for Excel VBA, so this is closer to having pre-determined input – Taylor Scott Mar 9 '18 at 16:04

# VBA, 358 bytes

An anonymous VBE immediate window function that takes no input and outputs to STDOUT.

?Split("It is certain1It is decidedly so1Without a doubt1Yes definitely1You may rely on it1As I see it, yes1Most likely1Outlook good1Yep1Signs point to yes1Reply hazy try again1Ask again later1Better not tell you now1Cannot predict now1Concentrate and ask again1Don't count on it1My reply is no1My sources say no1Outlook not so good1Very doubtful",1)(19*Rnd)

# Java 8, 379 Bytes

b->"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-Yep-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".split("-")[(int)(Math.random()*20)]

Try it online