Chutes (snakes1) & Ladders
When I was a child, the board-game "Chutes & Ladders" really grew my hatred for anything random.
The board is 10 x 10. The object of the game is to get your piece from the bottom left corner (1) to the top left corner (100). This means the numbers "snake" as they increase e.g.
square 10 steps "up" a row to square 11 and
square 11 steps "left" a column to square 12.
Basically the bottom two rows are:
20 19 18 17 16 15 14 13 12 11
1 2 3 4 5 6 7 8 9 10
Which the player would traverse in a counter-clockwise motion. My game used a spinner with 6 equal portions of a circle each representing a number 1 to 6. The same could be said for a die. A player gets to spin/roll once per turn and try to be the first player to reach 100.
Pretty simple idea, but there are pitfalls (chutes/snakes) and shortcuts (ladders) to, I don't know, make the game fun? My version had
- 18 Chutes & Ladders
- 9 chutes with a total change of -221
- 9 ladders with a total change of 171
Located at:
| If you land on | Go To | delta |
|----------------|-------|-------|
| 5 | 14 | 9 |
| 9 | 31 | 22 |
| 20 | 38 | 18 |
| 16 | 6 | -10 |
| 28 | 84 | 56 |
| 36 | 44 | 8 |
| 40 | 42 | 2 |
| 49 | 11 | -38 |
| 51 | 67 | 16 |
| 56 | 53 | -3 |
| 62 | 19 | -43 |
| 64 | 60 | -4 |
| 71 | 91 | 20 |
| 80 | 100 | 20 |
| 87 | 24 | -63 |
| 93 | 73 | -20 |
| 95 | 75 | -20 |
| 98 | 78 | -20 |
The Challenge
Write a program that
- Will generate a game-board with the same total change (Delta = -50)
- Has an arbitrary (>1) number of chutes and ladders
- Ensure NO square contains the beginning of both a chute and a ladder
- Ensure NO square contains the end of a chute and the beginning of a ladder
- Ensure NO square contains the end of a ladder and the beginning of a chute
- No chute has a positive change and no ladder a negative change
- No chute ends below 1 and no ladder ends above 100
- No ladder begins on Square 1 and no chute begins on Square 100
If you want to string chutes together or string ladders together, go for it. Beware though, children will cry. If you want 1 ladder and 17 chutes, go for that as well.
Note: the intent being that what you write can create many different boards, not just one static board.
But, you can put any restrictions on the possible scenario game-boards as you’d like.
Bonus – allow n players to play the game on the board
1https://en.wikipedia.org/wiki/Snakes_and_Ladders
I tried & did not succeed with this challenge in VBA. If you are curious what a dozen hours in VBA produces without result, proceed with caution