Have you ever heard of "Petals Around the Rose?" It's a logic puzzle. The way it works is, I roll five dice, then tell you what the "score" is for this round. I can repeat this for you as many times as you want. It's your job to figure out the algorithm that connects the roll of the dice to the score, and then determine the score for yourself on new rolls. There are three hints:
(i) the name of the puzzle is significant,
(ii) the answer will always be an even positive number or zero, and
(iii) people who know the secret are supposed to keep quiet about it!
So what we have here is an implementation of Petals Around the Rose, written using Tkinter. You click a button to roll the dice, which display in a canvas, along with the answer. Can you figure out the mystery?
I mean, you could just look at the code, but that would be cheating! Try to discern the pattern for yourself first by running the program, then peek under the hood.