From bbe0801ab1e0b0859c3529ed33fde40b139addd6 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 28 Dec 2015 08:44:36 -0800 Subject: 2548 - teach 'print' to print integers Still can't print non-integer numbers, so this is a bit hacky. The big consequence is that you can't print literal characters anymore because of our rules about how we pick which variant to statically dispatch to. You have to save to a character variable first. Maybe I can add an annotation to literals.. --- chessboard.mu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'chessboard.mu') diff --git a/chessboard.mu b/chessboard.mu index c8c84eed..e5f894fa 100644 --- a/chessboard.mu +++ b/chessboard.mu @@ -149,6 +149,7 @@ recipe print-board screen:address:screen, board:address:array:address:array:char local-scope load-ingredients row:number <- copy 7 # start printing from the top of the board + space:character <- copy 32/space # print each row { done?:boolean <- lesser-than row, 0 @@ -166,7 +167,7 @@ recipe print-board screen:address:screen, board:address:array:address:array:char f:address:array:character <- index *board, col c:character <- index *f, row print screen, c - print screen, 32/space + print screen, space col <- add col, 1 loop } -- cgit 1.4.1-2-gfad0