Brain-Teaser 907: Snakes & ladders
From The Sunday Times, 9th December 1979 [link]
During my recent trip into the jungle, I came across a clearing, at the centre of which was a stone with the following design:
On closer inspection, I saw that the small squares were numbered from 1 to 10 (left to right along the bottom row), then from 11 to 20 (right to left on the next row up), 21 to 30 (left to right on the third row up), and so on. The lines joined the following pairs of squares:
13 & 32
25 & 48
35 & 54
45 & 66
63 & 88
79 & 94My guide explained that it was a very old snakes and ladders board. However, due to the ravages of time, it was not possible to tell which of the six lines were snakes and which were ladders. Fortunately the guide knew a legend concerning the board, and he told it to me.
Many years ago, the king of that region had a beautiful daughter, and offered her in marriage to the first man who could get from square 1 to square 100 in just one turn. After many young men had tried and failed, a handsome prince from a neighbouring country had his turn, and threw 12 consecutive sixes. As he stood on square 1 to start, the first six took him to square 7. The remaining sixes took him to square 100.
Which of the lines are snakes?
This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 2 (1981). The puzzle text above is taken from the book.
It is also included in the book The Sunday Times Book of Brainteasers (1994).
[teaser914]









Jim Randell 10:00 am on 1 March 2022 Permalink |
We start with 6 linked squares, but we don’t know which way they “teleport”.
This Python program considers each roll of the dice, and progresses the player. If we reach an “unassigned” linked square we try both possible directions of teleportation. It runs in 49ms.
Run: [ @replit ]
from enigma import update, delete, printf # the linked squares links = [(13, 32), (25, 48), (35, 54), (45, 66), (63, 88), (79, 94)] # make a dict of potential "teleports" ps = dict() for (x, y) in links: ps[x] = y ps[y] = x # play the game # rs = remaining dice rolls # ps = potential teleports (src -> tgt) # ts = actual teleports (src -> tgt) # n = current position def solve(rs, ps, n=1, ts=dict()): # are we done? if not rs: if n == 100: yield (ts, ps) else: # add in the next roll n += rs[0] if n > 100: n = 100 n = ts.get(n, n) # is it a potential teleport? t = ps.get(n) if t is not None: ps_ = delete(ps, [n, t]) # choose to teleport yield from solve(rs[1:], ps_, t, update(ts, [(n, t)])) # choose not to teleport yield from solve(rs[1:], ps_, n, update(ts, [(t, n)])) else: # move on yield from solve(rs[1:], ps, n, ts) # solve for a finish in 12 throws of 6 for (ts, ps) in solve([6] * 12, ps): for (s, t) in sorted(ts.items()): printf("{s} -> {t} {x}", x=("snake" if t < s else "ladder")) printf("remaining = {ps}") printf()Solution: The lines (32 → 13) and (66 → 45) are snakes.
And the rest are ladders.
So play proceeds:
LikeLike