programdemos/rotate.xtl

Rotate along both axes: every frame moves the arrow one row down and one column right, wrapping around the edges of the board.

Run it with ./demos/rotate.xtl or "xetal run demos/rotate.xtl". It prints eight frames separated by a blank line ("just animate" plays them). Read -1 o̲-₁₂ b: one rotation along axes 1 and 2 together.

source

ᵘf̲rames : Num a => a -> b -> a

function · line 11

n u:f_rames b: prints board b and a blank line, then the next n - 1 frames, each b rotated one row down and one column right; gives 0.

ᵘf̲rames ← { n b →
  n = 0 ? n
  s ← p̲rint! b
  gap ← p̲rint! ""
  (n − 1) ᵘf̲rames -1 o̲-₁₂ b
}
Used in: ᵘf̲rames, shown

arrow : Char

value · line 18

The first frame: a 6 by 8 board of . with an arrow of # at its top left.

arrow ← 6 8 r̲eshape ".#.......##.....###.....##......#......................."
Used in: shown

shown : Int

value · line 20

The result of drawing eight frames, bound so it is not printed.

shown ← 8 ᵘf̲rames arrow