Part 1 of 6 · 1 min read
Why this page comes third in Level 6
In this module you will
- Apply the five-step method to a dice game.
- Model snakes and ladders as one concept and validate the board when it is built.
- Put the dice behind an interface so a test controls every roll.
- Code the turn loop with an exact-finish rule.
- Answer variants: extra turns, many dice, more players, and a different board.
Snake and ladder checks whether a candidate sees what is common between two things that look different, and whether randomness is kept out of the rules. It builds on tic-tac-toe (turns, status, bad input) and adds a random element that has to be made testable (Level 5, module 5). This page uses the five steps of Level 0, module 4. No book was supplied for this track, so the content is common practice, not from the books. The Java code was compiled and run before it was written here. Numbers marked "made up" only show the idea.