Game of the Goose Simulator
A Java Swing app that estimates by Monte Carlo simulation how many turns a Game of the Goose takes to finish, validates the estimate against an exact analytical solver, and plays it out on an isometric 2.5D board.
Game of the Goose Simulator
Practice 7 for the Advanced Algorithms course (21747) at the Universitat de les Illes Balears. A Java Swing application, on a Model–View–Controller architecture, that estimates — by Monte Carlo simulation — how many turns a game of the Game of the Goose (Juego de la Oca) takes to finish, and validates those estimates against an exact analytical solver.
The game
The Game of the Goose is a pure race decided entirely by dice: a token advances around a numbered board and lands on special squares (geese that jump forward, the bridge, the inn, the well, the maze, death…) that send it ahead or hold it back. It could be modelled exactly as a Markov chain, but instead the app answers the question probabilistically: it plays the game thousands of times with random dice and averages the results. From those runs it estimates the expected number of turns, the full distribution of game lengths, and how often each square is visited — and it plays the simulation out on an isometric 2.5D board with landing effects, a live token and heat-map / histogram views.
About
- Monte Carlo engine — a simulation engine runs many independent games, an observer streams live progress, and a statistics calculator turns the raw outcomes into the expected turns, the turn histogram and per-square visit frequencies with their confidence.
- Exact cross-check — an exact solver computes the expected number of turns analytically, and a Newton interpolator fits a polynomial to the sampled results, so the benchmark can show the simulation converging to the true value and compare methods and rule variants.
- Board model — the track and the effect of every special square are described in a small board model whose rule variants can be toggled and compared.
- Two workflows, one shared view — a simulation tab (isometric board, live token, heat map, turn histogram, win-probability chart) and a benchmark tab (convergence, method comparison and Newton-interpolation charts).
- Rendered board — the simulation view is a small isometric renderer of its own (projection, tile and solid painters, landmarks, floating numbers, token animation and landing effects): a deliberate 2.5D presentation of the board, not a flat grid.
- MVC +
Notify/Reporter— the controller runs the simulation and benchmark on background threads behind a cancellation token, reporting progress and telemetry through the message contract.
Executing the project
Requires a JDK 17 or newer — plain Java with Swing, no external dependencies or build tool. Open the P7/ folder in IntelliJ IDEA and run practice7.Main. Run a Monte Carlo batch in the simulation tab to watch the board play out and the statistics build up, then open the benchmark tab to see the estimate converge and compare it against the exact solver.