| 1 | #import "game.typ": render, apply-moves, parse-moves |
| 2 | |
| 3 | // Usage: |
| 4 | // #show: chess.with() |
| 5 | // g4 d5 Bg5 Bxg4 c4 c6 cxd5 cxd5 Qb3 |
| 6 | // |
| 7 | #let chess(body) = { |
| 8 | set page(height: auto, width: auto, margin: (top: 0.5in, bottom: 0.5in, rest: 0.5in)) |
| 9 | let moves = parse-moves(body) |
| 10 | let states = apply-moves(moves) |
| 11 | render(states.last()) |
| 12 | } |