This plays the lateral thinking game Petals Around the Rose. This is a game where 5 regular dice are rolled and the players then try to figure out how many petals are around the rose.
petals(plot = TRUE, txt = TRUE)
This function only returns NULL, it is run for its side effects.
Should the dice be plotted to the current/default graphics device.
Should the dice be shown in the console window using text.
Greg Snow, 538280@gmail.com
At least one of the arguments plot
and txt
needs to be
true, otherwise you will be guessing blind (or testing your psychic
abilities).
The game is usually played with 5 physical dice, one person who knows the rules (the potentate of the rose, here the computer), and one or more players trying to learn the puzzle. The potentate can only give the players the following 3 rules:
The name of the game is "Petals Around the Rose" and the name is significant.
The answer is always 0 or an even number.
The potentate can tell the answer for any roll after any guesses are made.
The potentate (or other player) then rolls the 5 dice and any players are then allowed to guess. The potentate either confirms a correct guess or tells the correct answer, then the game continues with another roll. Players are not to discuss their reasoning so that each can solve it themselves. When a player thinks they have worked out the reasoning they demonstrate it by getting correct guesses, but not by discussing it with anyone. Generally 6 correct guesses in a row is considered evidence that they have figured out the rules and they are then considered a potentate of the rose.
For this implementation the computer will simulate the role of 5 dice and display the results and ask for a guess of how many petals are around the rose. The player then enters their guess and the computer then either confirms that it is correct or gives the correct answer.
Pressing enter without making a guess ends the game.
dice