Spreadsheet Institute

Home of Spreadsheet Lisp (SL)


            
    DEFINE(
        MAGIC8BALL,
        LAMBDA(
            [question],
            IF(
                PROVIDED(question),
                CHOOSE(
                    RANDBETWEEN(1, 20),
                    "It is certain",
                    "Reply hazy, try again",
                    "It is decidedly so",
                    "Without a doubt",
                    "Don't count on it",
                    "Yes, definitely",
                    "Ask again later",
                    "You may rely on it",
                    "My reply is no",
                    "As I see it, yes",
                    "Better not tell you now",
                    "Most likely",
                    "My sources say no",
                    "Outlook good",
                    "Cannot predict now",
                    "Yes",
                    "Outlook not so good",
                    "Signs point to yes",
                    "Concentrate and ask again",
                    "Very doubtful"),
                "Ask, and you will be answered")))