This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var g0 = 'Hello, World!' | |
var g1 = 'Howdy, universe!' | |
var g2 = 'Oh no, not again!' | |
var greeting = function(sunny) { | |
return function() { | |
var greetingChoice = sunny ? flip(0.6) : flip(0.2) | |
var altAnswer = sunny ? g1 : g2 | |
return greetingChoice ? g0 : altAnswer | |
} |