Coin Flip Simulator
This coin flip simulator has a 3D token, streak counter and best-of-3, 5, 7 or 9 series.
- Genre
- Simulation
- Players
- 1
- Works on phone
- Yes
- Length
- Single flips or a best-of-3, 5, 7 or 9 series
- Made with
- Codex
- Maker
- Claude Game Studio
How to play
- Press Flip coin for a heads-or-tails result. The 3D token turns to show H or T.
- Choose Single flips or a best-of-3, 5, 7 or 9 series. A series stops when one side wins a majority.
- Read the current streak, longest streak and history. New series clears the counts; Copy result saves the outcome as text.
Tips
- Agree which option is Heads and which is Tails before you flip.
- Best of 5 stops as soon as one side wins three flips. It does not need all five tosses.
- A long streak does not change the next flip's chance. Each result uses a new browser-generated random choice.
About Coin Flip Simulator
Coin Flip Simulator uses an original gold token marked H and T. Press Flip coin to send it through a short 3D tumble, then read the outcome and the running counts. Single flips keep going for as long as you want. The history shows the latest 100 outcomes while the totals and longest streak cover the whole current session.
Best-of mode changes the stopping rule. A best-of-3 series ends at two wins for either side; best of 5 ends at three, best of 7 at four and best of 9 at five. For example, Heads, Tails, Heads ends a best-of-3 series with a 2–1 Heads win. New series resets the counters and begins again.
The next outcome is chosen independently with Web Crypto before the animation starts. The streak counter measures consecutive matching results, and Longest keeps the largest run since reset. A run of tails does not make heads due next. Copy result includes the last outcome, both counts and the winner or current streak, plus this page's link.
Is each simulated coin flip 50/50?
The code maps a fresh browser-generated random integer to one of two equally sized outcomes. It does not alternate heads and tails or adjust for earlier results. A short series can finish unevenly.
When does best of 5 end?
It ends when Heads or Tails reaches three wins. That can take three, four or five flips. The same majority rule applies to best of 3, 7 and 9.
What is the coin flip streak counter?
It counts consecutive identical results. Heads, Heads, Tails gives a current streak of one and a longest streak of two. New series resets both.
Make one like this
Best-of modes stop at 2, 3, 4 or 5 wins, with a current streak and the longest run since reset.
This was the prompt:
Build a coin flip simulator with a 3D coin, a streak counter, and best-of-N mode.
- Build time
- 10.1 minutes
- Model cost
- Not reported
- Game file
- 482.2 kB
The clock measures elapsed maker time from setup to the first compiled build checked in Node, including shared work across these five games. It is separate from play time. The kit records no per-game model charge for this run. Open the build measurements.
About the rules and tools
- MDN: Crypto.getRandomValues(). Each flip draws a new random integer from the browser API.
- Stanford CS109: independence. The independence explanation applies to the simulator's fresh random draws; the current streak does not change the next draw.