about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-02 15:44:51 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-02 15:44:51 -0800
commitd99607231dd767df599478bb0bbc68d0a3483d1a (patch)
treeec5d95cb333d827d2916ced83ef429aeee2ed60e
parent3f29fba81b8bbb4b1c1cba01c30ad2157dc6125b (diff)
downloadmu-d99607231dd767df599478bb0bbc68d0a3483d1a.tar.gz
496
-rw-r--r--chessboard.mu9
1 files changed, 9 insertions, 0 deletions
diff --git a/chessboard.mu b/chessboard.mu
index 5ed8ddc9..71e3da92 100644
--- a/chessboard.mu
+++ b/chessboard.mu
@@ -1,3 +1,12 @@
+;; data structure: board
+(primitive square)
+(address square-address (square))  ; pointer. verbose but sadly necessary for now
+(array file (square))  ; ranks and files are arrays of squares
+(address file-address (file))
+(address file-address-address (file-address))  ; pointer to a pointer
+(array board (file-address))
+(address board-address (board))
+
 (function read-board [
   (default-scope:scope-address <- new scope:literal 30:literal)
   (initial-position:list-address <- init-list R:literal P:literal _:literal _:literal _:literal _:literal p:literal r:literal