programgames/maze/maze.xtl

The maze, scripted (seed 1), with the rules of Walls.xtl: a maze carved with whole-array operations, the way out found by a flood, and the view ahead looked up at every depth at once.

source · imports mz: games/maze/Walls.xtl

s : (Int, Int, Int, Int, Bool, Int, Int)

value · line 11
s ← ᵐᶻn̲ew 0

ᵘp̲ress : (Num a, Truthy b, Num c, Any d) => (Int, Int, Int, a, b, c, d) -> Char -> (Int, Int, Int, a, b, c, d)

function · line 24
ᵘp̲ress ← { s k → s ᵐᶻk̲ey k }
Used in: walked

walked : (Int, Int, Int, Int, Bool, Int, Int)

value · line 25
walked ← (((s ᵘp̲ress "m") ᵘp̲ress "UP") ᵘp̲ress "UP") ᵘp̲ress "RIGHT"

_ : Char

function · line 30
_ ← ⎕S̲HOW ᵐᶻd̲raw walked

t : (Int, Int, Int, Int, Bool, Int, Int)

value · line 33
t ← ᵐᶻn̲ew 0
Used in: _

_ : Unit

function · line 34
_ ← "'& r_/ (0 <= r_avel mz:d_istances t) = r_avel 0 = mz:g_rid t" a̲ssert< "every open block can be reached"
a̲ssert< expands to
({ @ → ('∧ r̲/ (0 ≤ r̲avel ᵐᶻd̲istances t) = r̲avel 0 = ᵐᶻg̲rid t) ? @◆ ⎕E̲RR "assertion failed: '& r_/ (0 <= r_avel mz:d_istances t) = r_avel 0 = mz:g_rid t (every open block can be reached) [games/maze/maze.xtl:34]"◆ @ } @)

_ : Unit

function · line 35
_ ← "0 = mz:s_tatus walked" a̲ssert< "still looking"
a̲ssert< expands to
({ @ → (0 = ᵐᶻs̲tatus walked) ? @◆ ⎕E̲RR "assertion failed: 0 = mz:s_tatus walked (still looking) [games/maze/maze.xtl:35]"◆ @ } @)