11
Maybe some of you already know this game: you have a collection of jelly beans of different colors. For every color, the bean can have different tastes, some are good and some are bad, and you cannot tell them apart. You have to pick a bean of a given color, and pray you have select a good one.
So, write the shortest program that receives a color of your choice (from a given list), and randomly returns the taste selected. The taste has to be picked from a built-in list. The possible list of inputs and outputs are:
Input Output choices [only one from the list]
--------------------------------------------------
green lawn clippings, lime, mucus, pear
yellow rotten eggs, buttered popcorn
blue toothpaste, blue berry
orange vomit, peach
brown canned dog food, chocolate
white stinky socks, tutti-frutti, baby diapers, coconut
Rules:
- You can assume that the input is going to be always a color from the input choices.
- Case and trailing spaces and/or newlines do not matter.
- Output must be uniformly random: succesive program executions must yield different results, and the chances of getting a given taste must be the same for all tastes in a list.
This is code-golf, so may the shortest program win!
In one part of your question, you state that the taste will be selected from a given list, implying that we will receive it as input. However, in your examples, it seems the opposite is so. – Okx – 2017-06-09T11:53:35.503
@Okx sorry, is it better now? I'm still getting used to posting here... – Charlie – 2017-06-09T11:56:57.023
1Maybe state that the output must be uniformly random so that all possible outputs have the same odds of appearing or else I can just add 2 options from each list. – LiefdeWen – 2017-06-09T11:57:17.953
@StefanDelport thank you, fixed! – Charlie – 2017-06-09T11:58:55.367
1It's a bit late now, but it should probably have been
blueberry
notblue berry
. – Jonathan Allan – 2017-06-09T20:39:06.147