diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-05-07 11:56:43 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-05-07 11:56:43 -0700 |
commit | d605ba1f9ab08ead61a73f2f102fd8741b4c0352 (patch) | |
tree | 1709e67a75d8f71b4fa3a79d6d3fe8a0c51c1f73 /shell/data.limg | |
parent | d8298d1a2af876915cd4ba8d6a7b5ae7dc2dd0e3 (diff) | |
download | mu-d605ba1f9ab08ead61a73f2f102fd8741b4c0352.tar.gz |
clean up chessboard
We still benefit from some helpers here because of the unrolling and multiple calls to helpers.
Diffstat (limited to 'shell/data.limg')
-rw-r--r-- | shell/data.limg | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/shell/data.limg b/shell/data.limg index 26b7a27d..070f24fa 100644 --- a/shell/data.limg +++ b/shell/data.limg @@ -53,19 +53,21 @@ (set c (key keyboard)))) str)))]) (chessboard . [(def chessboard (fn (screen px) - (chessboard1 screen px 0 15)))]) - (chessboard1 . [(def chessboard1 (fn (screen px y color) (clear screen) - (while (< y (height screen)) - (chessboard2 screen px y 0 color) + (let xmax (width screen) + (let ymax (height screen) + (let y 0 + (while (< y ymax) + (chessboard_row screen px y 0 xmax) (set y (+ y px)) - (chessboard2 screen px y px color) + (chessboard_row screen px y px xmax) (set y (+ y px)))))]) - (chessboard2 . [(def chessboard2 (fn (screen px y x color) - (while (< x (width screen)) - (fill_rect screen x y (+ x px) (+ y px) color) - (set x (+ x px)) - (set x (+ x px)))))]) + (chessboard_row . [(def chessboard_row (fn (screen px y x xmax) + (while (< x xmax) + (fill_rect screen + x y + (+ x px) (+ y px) 15) + (set x (+ x (* px 2))))))]) (brcircle . [(def brcircle (fn (screen cx cy r color) ((fn (x y err continue) (while continue |