about summary refs log tree commit diff stats
path: root/chessboard.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-12 00:06:40 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-12 00:38:36 -0700
commitea19d0dc2c11f48ca384fb087b4e44ef400bfaa2 (patch)
treeba204ece67397481a3104f4c7c1d6a0f3ad271f7 /chessboard.mu
parentec1cd4ae38f283970a401354a1ec17823fa0b7da (diff)
downloadmu-ea19d0dc2c11f48ca384fb087b4e44ef400bfaa2.tar.gz
3337 - first use of type abbreviations: text
In the process I've uncover a couple of situations we don't support type
abbreviations yet. They're next.
Diffstat (limited to 'chessboard.mu')
-rw-r--r--chessboard.mu8
1 files changed, 5 insertions, 3 deletions
diff --git a/chessboard.mu b/chessboard.mu
index c7c02648..b58f2d6b 100644
--- a/chessboard.mu
+++ b/chessboard.mu
@@ -62,10 +62,12 @@ scenario print-board-and-read-move [
 
 ## Here's how 'chessboard' is implemented.
 
+type board = address:array:address:array:character
+
 def chessboard screen:address:screen, console:address:console -> screen:address:screen, console:address:console [
   local-scope
   load-ingredients
-  board:address:array:address:array:character <- initial-position
+  board:board <- initial-position
   # hook up stdin
   stdin-in:address:source:character, stdin-out:address:sink:character <- new-channel 10/capacity
   start-running send-keys-to-channel, console, stdin-out, screen
@@ -200,7 +202,7 @@ scenario printing-the-board [
   assume-screen 30/width, 12/height
   run [
     local-scope
-    board:address:array:address:array:character <- initial-position
+    board:board <- initial-position
     screen:address:screen <- print-board screen:address:screen, board
   ]
   screen-should-contain [
@@ -548,7 +550,7 @@ scenario making-a-move [
   assume-screen 30/width, 12/height
   run [
     local-scope
-    board:address:array:address:array:character <- initial-position
+    board:board <- initial-position
     move:address:move <- new move:type
     *move <- merge 6/g, 1/'2', 6/g, 3/'4'
     board <- make-move board, move