From 3ebc41870128148b862c128f4c91639c9eb23c24 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 22 Jan 2017 16:16:32 -0800 Subject: 3737 --- html/081print.mu.html | 73 +++++++++++++++++++------------------- html/chessboard.mu.html | 2 +- html/edit/005-sandbox.mu.html | 4 +-- html/edit/008-sandbox-edit.mu.html | 6 ++-- 4 files changed, 42 insertions(+), 43 deletions(-) (limited to 'html') diff --git a/html/081print.mu.html b/html/081print.mu.html index cb658d20..33ddf53a 100644 --- a/html/081print.mu.html +++ b/html/081print.mu.html @@ -745,7 +745,7 @@ if ('onhashchange' in window) { 684 ] 685 ] 686 -687 def print-integer screen:&:screen, n:num -> screen:&:screen [ +687 def print screen:&:screen, n:num -> screen:&:screen [ 688 local-scope 689 load-ingredients 690 color:num, color-found?:bool <- next-ingredient @@ -765,44 +765,43 @@ if ('onhashchange' in window) { 704 screen <- print screen, s, color, bg-color 705 ] 706 -707 # for now, we can only print integers -708 def print screen:&:screen, n:num -> screen:&:screen [ -709 local-scope -710 load-ingredients -711 color:num, color-found?:bool <- next-ingredient -712 { -713 # default color to white -714 break-if color-found? -715 color <- copy 7/white -716 } -717 bg-color:num, bg-color-found?:bool <- next-ingredient -718 { -719 # default bg-color to black -720 break-if bg-color-found? -721 bg-color <- copy 0/black -722 } -723 screen <- print-integer screen, n, color, bg-color +707 def print screen:&:screen, n:bool -> screen:&:screen [ +708 local-scope +709 load-ingredients +710 color:num, color-found?:bool <- next-ingredient +711 { +712 # default color to white +713 break-if color-found? +714 color <- copy 7/white +715 } +716 bg-color:num, bg-color-found?:bool <- next-ingredient +717 { +718 # default bg-color to black +719 break-if bg-color-found? +720 bg-color <- copy 0/black +721 } +722 n2:num <- copy n +723 screen <- print screen, n2, color, bg-color 724 ] 725 -726 # addresses -727 def print screen:&:screen, n:&:_elem -> screen:&:screen [ -728 local-scope -729 load-ingredients -730 color:num, color-found?:bool <- next-ingredient -731 { -732 # default color to white -733 break-if color-found? -734 color <- copy 7/white -735 } -736 bg-color:num, bg-color-found?:bool <- next-ingredient -737 { -738 # default bg-color to black -739 break-if bg-color-found? -740 bg-color <- copy 0/black -741 } -742 n2:num <- copy n -743 screen <- print-integer screen, n2, color, bg-color -744 ] +726 def print screen:&:screen, n:&:_elem -> screen:&:screen [ +727 local-scope +728 load-ingredients +729 color:num, color-found?:bool <- next-ingredient +730 { +731 # default color to white +732 break-if color-found? +733 color <- copy 7/white +734 } +735 bg-color:num, bg-color-found?:bool <- next-ingredient +736 { +737 # default bg-color to black +738 break-if bg-color-found? +739 bg-color <- copy 0/black +740 } +741 n2:num <- copy n +742 screen <- print screen, n2, color, bg-color +743 ] diff --git a/html/chessboard.mu.html b/html/chessboard.mu.html index 3abf7bd9..419f3961 100644 --- a/html/chessboard.mu.html +++ b/html/chessboard.mu.html @@ -213,7 +213,7 @@ if ('onhashchange' in window) { 151 break-if done? 152 # print rank number as a legend 153 rank:num <- add row, 1 -154 print-integer screen, rank +154 print screen, rank 155 print screen, [ | ] 156 # print each square in the row 157 col:num <- copy 0 diff --git a/html/edit/005-sandbox.mu.html b/html/edit/005-sandbox.mu.html index bd92a649..28de0027 100644 --- a/html/edit/005-sandbox.mu.html +++ b/html/edit/005-sandbox.mu.html @@ -641,7 +641,7 @@ if ('onhashchange' in window) { 580 assume-resources [ 581 ] 582 # sandbox editor contains an instruction - 583 env:&:environment <- new-programming-environment resources, screen, [print-integer screen, 4] # contents of sandbox editor + 583 env:&:environment <- new-programming-environment resources, screen, [print screen, 4] # contents of sandbox editor 584 # run the code in the editor 585 assume-console [ 586 press F4 @@ -655,7 +655,7 @@ if ('onhashchange' in window) { 594 . ╎ . 595 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. 596 . ╎0 edit copy delete . - 597 . ╎print-integer screen, 4 . + 597 . ╎print screen, 4 . 598 . ╎screen: . 599 . ╎ .4 . . 600 . ╎ . . . diff --git a/html/edit/008-sandbox-edit.mu.html b/html/edit/008-sandbox-edit.mu.html index 4ba0897a..e253a4c5 100644 --- a/html/edit/008-sandbox-edit.mu.html +++ b/html/edit/008-sandbox-edit.mu.html @@ -225,7 +225,7 @@ if ('onhashchange' in window) { 165 assume-resources [ 166 ] 167 # right editor contains a print instruction -168 env:&:environment <- new-programming-environment resources, screen, [print-integer screen, 4] +168 env:&:environment <- new-programming-environment resources, screen, [print screen, 4] 169 # run the sandbox 170 assume-console [ 171 press F4 @@ -236,7 +236,7 @@ if ('onhashchange' in window) { 176 . ╎ . 177 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. 178 . ╎0 edit copy delete . -179 . ╎print-integer screen, 4 . +179 . ╎print screen, 4 . 180 . ╎screen: . 181 . ╎ .4 . . 182 . ╎ . . . @@ -255,7 +255,7 @@ if ('onhashchange' in window) { 195 ] 196 screen-should-contain [ 197 . run (F4) . -198 . ╎print-integer screen, 4 . +198 . ╎print screen, 4 . 199 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. 200 . ╎ . 201 . ╎ . -- cgit 1.4.1-2-gfad0