coin2dice

from blog Home on Erik Bernhardsson, | ↗ original
Here's a problem that I used to give to candidates. I stopped using it seriously a long time ago since I don't believe in puzzles, but I think it's kind of fun. Let's say you have a function that simulates a random coin flip.