about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--081print.mu14
-rw-r--r--edit/005-sandbox.mu27
-rw-r--r--edit/006-sandbox-edit.mu4
-rw-r--r--edit/007-sandbox-delete.mu6
-rw-r--r--edit/008-sandbox-test.mu4
-rw-r--r--edit/009-sandbox-trace.mu10
-rw-r--r--edit/010-warnings.mu16
-rw-r--r--sandbox/005-sandbox.mu23
-rw-r--r--sandbox/006-sandbox-edit.mu4
-rw-r--r--sandbox/007-sandbox-delete.mu6
-rw-r--r--sandbox/009-sandbox-trace.mu10
-rw-r--r--sandbox/010-warnings.mu6
12 files changed, 80 insertions, 50 deletions
diff --git a/081print.mu b/081print.mu
index bb2f1636..464e1320 100644
--- a/081print.mu
+++ b/081print.mu
@@ -683,5 +683,17 @@ recipe print-integer screen:address:shared:screen, n:number -> screen:address:sh
 recipe print screen:address:shared:screen, n:number -> screen:address:shared:screen [
   local-scope
   load-ingredients
-  screen <- print-integer screen, n
+  color:number, color-found?:boolean <- next-ingredient
+  {
+    # default color to white
+    break-if color-found?
+    color <- copy 7/white
+  }
+  bg-color:number, bg-color-found?:boolean <- next-ingredient
+  {
+    # default bg-color to black
+    break-if bg-color-found?
+    bg-color <- copy 0/black
+  }
+  screen <- print-integer screen, n, color, bg-color
 ]
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu
index 3095e865..6b442a91 100644
--- a/edit/005-sandbox.mu
+++ b/edit/005-sandbox.mu
@@ -53,7 +53,7 @@ scenario run-and-show-results [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊divide-with-remainder 11, 3                      .
     .                                                  ┊3                                                .
     .                                                  ┊2                                                .
@@ -82,6 +82,13 @@ scenario run-and-show-results [
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                                  ┊                                                 .
   ]
+  # sandbox title in reverse video
+  screen-should-contain-in-color 0/black, [
+    .                                                                                                    .
+    .                                                                                                    .
+    .                                                                                                    .
+    .                                                   0                                                .
+  ]
   # run another command
   assume-console [
     left-click 1, 80
@@ -96,11 +103,11 @@ scenario run-and-show-results [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊add 2, 2                                         .
     .                                                  ┊4                                                .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊1                                               x.
     .                                                  ┊divide-with-remainder 11, 3                      .
     .                                                  ┊3                                                .
     .                                                  ┊2                                                .
@@ -237,11 +244,11 @@ recipe! render-sandbox-side screen:address:shared:screen, env:address:shared:pro
   row <- add row, 1
   draw-horizontal screen, row, left, right, 9473/horizontal-double
   sandbox:address:shared:sandbox-data <- get *env, sandbox:offset
-  row, screen <- render-sandboxes screen, sandbox, left, right, row
+  row, screen <- render-sandboxes screen, sandbox, left, right, row, 0
   clear-rest-of-screen screen, row, left, left, right
 ]
 
-recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number -> row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [
+recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number, idx:number -> row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [
   local-scope
   load-ingredients
 #?   $log [render sandbox]
@@ -252,6 +259,7 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san
   # render sandbox menu
   row <- add row, 1
   screen <- move-cursor screen, row, left
+  print screen, idx, 0/black, 245/grey
   clear-line-delimited screen, left, right
   delete-icon:character <- copy 120/x
   print screen, delete-icon, 245/grey
@@ -288,7 +296,8 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san
   draw-horizontal screen, row, left, right, 9473/horizontal-double
   # draw next sandbox
   next-sandbox:address:shared:sandbox-data <- get *sandbox, next-sandbox:offset
-  row, screen <- render-sandboxes screen, next-sandbox, left, right, row
+  next-idx:number <- add idx, 1
+  row, screen <- render-sandboxes screen, next-sandbox, left, right, row, next-idx
 ]
 
 # assumes programming environment has no sandboxes; restores them from previous session
@@ -411,7 +420,7 @@ reply z
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .z:number <- add 2, 2                              ┊                                                x.
+    .z:number <- add 2, 2                              ┊0                                               x.
     .reply z                                           ┊foo                                              .
     .]                                                 ┊4                                                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -432,7 +441,7 @@ reply z
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .z:number <- add 2, 3                              ┊                                                x.
+    .z:number <- add 2, 3                              ┊0                                               x.
     .reply z                                           ┊foo                                              .
     .]                                                 ┊5                                                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -460,7 +469,7 @@ scenario run-instruction-manages-screen-per-sandbox [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊print-integer screen, 4                          .
     .                                                  ┊screen:                                          .
     .                                                  ┊  .4                             .               .
diff --git a/edit/006-sandbox-edit.mu b/edit/006-sandbox-edit.mu
index 80ceb2b9..db4dd2a8 100644
--- a/edit/006-sandbox-edit.mu
+++ b/edit/006-sandbox-edit.mu
@@ -19,7 +19,7 @@ recipe foo [
     .                     run (F4)           .
     .                    ┊                   .
     .recipe foo [        ┊━━━━━━━━━━━━━━━━━━━.
-    .  reply 4           ┊                  x.
+    .  reply 4           ┊0                 x.
     .]                   ┊foo                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4                  .
     .                    ┊━━━━━━━━━━━━━━━━━━━.
@@ -140,7 +140,7 @@ scenario sandbox-with-print-can-be-edited [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊print-integer screen, 4                          .
     .                                                  ┊screen:                                          .
     .                                                  ┊  .4                             .               .
diff --git a/edit/007-sandbox-delete.mu b/edit/007-sandbox-delete.mu
index 95b6042f..3cbe7d5d 100644
--- a/edit/007-sandbox-delete.mu
+++ b/edit/007-sandbox-delete.mu
@@ -19,11 +19,11 @@ scenario deleting-sandboxes [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊add 2, 2                                         .
     .                                                  ┊4                                                .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊1                                               x.
     .                                                  ┊divide-with-remainder 11, 3                      .
     .                                                  ┊3                                                .
     .                                                  ┊2                                                .
@@ -41,7 +41,7 @@ scenario deleting-sandboxes [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊add 2, 2                                         .
     .                                                  ┊4                                                .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
diff --git a/edit/008-sandbox-test.mu b/edit/008-sandbox-test.mu
index b15eb37e..b525cfd1 100644
--- a/edit/008-sandbox-test.mu
+++ b/edit/008-sandbox-test.mu
@@ -19,7 +19,7 @@ recipe foo [
     .                     run (F4)           .
     .                    ┊                   .
     .recipe foo [        ┊━━━━━━━━━━━━━━━━━━━.
-    .  reply 4           ┊                  x.
+    .  reply 4           ┊0                 x.
     .]                   ┊foo                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4                  .
     .                    ┊━━━━━━━━━━━━━━━━━━━.
@@ -52,7 +52,7 @@ recipe foo [
     .                     run (F4)           .
     .␣                   ┊                   .
     .recipe foo [        ┊━━━━━━━━━━━━━━━━━━━.
-    .  reply 4           ┊                  x.
+    .  reply 4           ┊0                 x.
     .]                   ┊foo                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4                  .
     .                    ┊━━━━━━━━━━━━━━━━━━━.
diff --git a/edit/009-sandbox-trace.mu b/edit/009-sandbox-trace.mu
index 92d46bc0..ddf3dbf5 100644
--- a/edit/009-sandbox-trace.mu
+++ b/edit/009-sandbox-trace.mu
@@ -19,7 +19,7 @@ recipe foo [
     .                     run (F4)           .
     .                    ┊                   .
     .recipe foo [        ┊━━━━━━━━━━━━━━━━━━━.
-    .  stash [abc]       ┊                  x.
+    .  stash [abc]       ┊0                 x.
     .]                   ┊foo                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━.
     .                    ┊                   .
@@ -38,7 +38,7 @@ recipe foo [
     .                     run (F4)           .
     .␣                   ┊                   .
     .recipe foo [        ┊━━━━━━━━━━━━━━━━━━━.
-    .  stash [abc]       ┊                  x.
+    .  stash [abc]       ┊0                 x.
     .]                   ┊foo                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊abc                .
     .                    ┊━━━━━━━━━━━━━━━━━━━.
@@ -67,7 +67,7 @@ recipe foo [
     .                     run (F4)           .
     .␣                   ┊                   .
     .recipe foo [        ┊━━━━━━━━━━━━━━━━━━━.
-    .  stash [abc]       ┊                  x.
+    .  stash [abc]       ┊0                 x.
     .]                   ┊foo                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━.
     .                    ┊                   .
@@ -94,7 +94,7 @@ recipe foo [
     .                     run (F4)           .
     .                    ┊                   .
     .recipe foo [        ┊━━━━━━━━━━━━━━━━━━━.
-    .  stash [abc]       ┊                  x.
+    .  stash [abc]       ┊0                 x.
     .  reply 4           ┊foo                .
     .]                   ┊4                  .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━.
@@ -112,7 +112,7 @@ recipe foo [
     .                     run (F4)           .
     .                    ┊                   .
     .recipe foo [        ┊━━━━━━━━━━━━━━━━━━━.
-    .  stash [abc]       ┊                  x.
+    .  stash [abc]       ┊0                 x.
     .  reply 4           ┊foo                .
     .]                   ┊abc                .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4                  .
diff --git a/edit/010-warnings.mu b/edit/010-warnings.mu
index 61cac2d2..313de970 100644
--- a/edit/010-warnings.mu
+++ b/edit/010-warnings.mu
@@ -144,7 +144,7 @@ scenario run-hides-warnings-from-past-sandboxes [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊add 2, 2                                         .
     .                                                  ┊4                                                .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -173,7 +173,7 @@ z <- add x, [a]
     .                                                                                 run (F4)           .
     .recipe foo x:_elem -> z:_elem [                   ┊                                                 .
     .local-scope                                       ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .load-ingredients                                  ┊                                                x.
+    .load-ingredients                                  ┊0                                               x.
     .z <- add x, [a]                                   ┊foo 2                                            .
     .]                                                 ┊foo_2: 'add' requires number ingredients, but go↩.
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊t [a]                                            .
@@ -192,7 +192,7 @@ z <- add x, [a]
     .                                                                                 run (F4)           .
     .recipe foo x:_elem -> z:_elem [                   ┊                                                 .
     .local-scope                                       ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .load-ingredients                                  ┊                                                x.
+    .load-ingredients                                  ┊0                                               x.
     .z <- add x, [a]                                   ┊foo 2                                            .
     .]                                                 ┊foo_2: 'add' requires number ingredients, but go↩.
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊t [a]                                            .
@@ -444,7 +444,7 @@ scenario run-instruction-and-print-warnings [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊get 1234:number, foo:offset                      .
     .                                                  ┊unknown element foo in container number          .
     .                                                  ┊first ingredient of 'get' should be a container,↩.
@@ -508,7 +508,7 @@ scenario run-instruction-and-print-warnings-only-once [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
+    .                                                  ┊0                                               x.
     .                                                  ┊get 1234:number, foo:offset                      .
     .                                                  ┊unknown element foo in container number          .
     .                                                  ┊first ingredient of 'get' should be a container,↩.
@@ -541,7 +541,7 @@ scenario sandbox-can-handle-infinite-loop [
     .                                                                                 run (F4)           .
     .recipe foo [                                      ┊                                                 .
     .  {                                               ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .    loop                                          ┊                                                x.
+    .    loop                                          ┊0                                               x.
     .  }                                               ┊foo                                              .
     .]                                                 ┊took too long!                                   .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -573,7 +573,7 @@ reply b
     .                                                                                 run (F4)           .
     .recipe foo [                                      ┊                                                 .
     .local-scope                                       ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .a:number <- next-ingredient                       ┊                                                x.
+    .a:number <- next-ingredient                       ┊0                                               x.
     .b:number <- next-ingredient                       ┊foo 4, 0                                         .
     .stash [dividing by], b                            ┊foo: divide by zero in '_, c:number <- divide-wi↩.
     ._, c:number <- divide-with-remainder a, b         ┊th-remainder a, b'                               .
@@ -592,7 +592,7 @@ reply b
     .                                                                                 run (F4)           .
     .recipe foo [                                      ┊                                                 .
     .local-scope                                       ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .a:number <- next-ingredient                       ┊                                                x.
+    .a:number <- next-ingredient                       ┊0                                               x.
     .b:number <- next-ingredient                       ┊foo 4, 0                                         .
     .stash [dividing by], b                            ┊dividing by 0                                    .
     ._, c:number <- divide-with-remainder a, b         ┊foo: divide by zero in '_, c:number <- divide-wi↩.
diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu
index 405dee01..2ad25dd4 100644
--- a/sandbox/005-sandbox.mu
+++ b/sandbox/005-sandbox.mu
@@ -38,7 +38,7 @@ scenario run-and-show-results [
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .divide-with-remainder 11, 3                       .
     .3                                                 .
     .2                                                 .
@@ -67,6 +67,13 @@ scenario run-and-show-results [
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                                  .
   ]
+  # sandbox title in reverse video
+  screen-should-contain-in-color 0/black, [
+    .                                                  .
+    .                                                  .
+    .                                                  .
+    .0                                                 .
+  ]
   # run another command
   assume-console [
     left-click 1, 80
@@ -81,11 +88,11 @@ scenario run-and-show-results [
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .add 2, 2                                          .
     .4                                                 .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .1                                                x.
     .divide-with-remainder 11, 3                       .
     .3                                                 .
     .2                                                 .
@@ -218,11 +225,11 @@ recipe! render-sandbox-side screen:address:shared:screen, env:address:shared:pro
   row <- add row, 1
   draw-horizontal screen, row, left, right, 9473/horizontal-double
   sandbox:address:shared:sandbox-data <- get *env, sandbox:offset
-  row, screen <- render-sandboxes screen, sandbox, left, right, row, env
+  row, screen <- render-sandboxes screen, sandbox, left, right, row, 0, env
   clear-rest-of-screen screen, row, left, left, right
 ]
 
-recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number -> row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [
+recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number, idx:number -> row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [
   local-scope
   load-ingredients
   env:address:shared:programming-environment-data, _/optional <- next-ingredient
@@ -233,6 +240,7 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san
   # render sandbox menu
   row <- add row, 1
   screen <- move-cursor screen, row, left
+  print screen, idx, 0/black, 245/grey
   clear-line-delimited screen, left, right
   delete-icon:character <- copy 120/x
   print screen, delete-icon, 245/grey
@@ -269,7 +277,8 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san
   draw-horizontal screen, row, left, right, 9473/horizontal-double
   # draw next sandbox
   next-sandbox:address:shared:sandbox-data <- get *sandbox, next-sandbox:offset
-  row, screen <- render-sandboxes screen, next-sandbox, left, right, row
+  next-idx:number <- add idx, 1
+  row, screen <- render-sandboxes screen, next-sandbox, left, right, row, next-idx, env
 ]
 
 # assumes programming environment has no sandboxes; restores them from previous session
@@ -389,7 +398,7 @@ scenario run-instruction-manages-screen-per-sandbox [
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .print-integer screen, 4                           .
     .screen:                                           .
     .  .4                             .                .
diff --git a/sandbox/006-sandbox-edit.mu b/sandbox/006-sandbox-edit.mu
index 4b4c5175..87bf3e38 100644
--- a/sandbox/006-sandbox-edit.mu
+++ b/sandbox/006-sandbox-edit.mu
@@ -14,7 +14,7 @@ scenario clicking-on-a-sandbox-moves-it-to-editor [
     .                     run (F4)           .
     .                                        .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                       x.
+    .0                                      x.
     .add 2, 2                                .
     .4                                       .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -138,7 +138,7 @@ scenario sandbox-with-print-can-be-edited [
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .print-integer screen, 4                           .
     .screen:                                           .
     .  .4                             .                .
diff --git a/sandbox/007-sandbox-delete.mu b/sandbox/007-sandbox-delete.mu
index 64843d2d..3df785f5 100644
--- a/sandbox/007-sandbox-delete.mu
+++ b/sandbox/007-sandbox-delete.mu
@@ -18,11 +18,11 @@ scenario deleting-sandboxes [
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .add 2, 2                                          .
     .4                                                 .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .1                                                x.
     .divide-with-remainder 11, 3                       .
     .3                                                 .
     .2                                                 .
@@ -40,7 +40,7 @@ scenario deleting-sandboxes [
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .add 2, 2                                          .
     .4                                                 .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
diff --git a/sandbox/009-sandbox-trace.mu b/sandbox/009-sandbox-trace.mu
index 5c9c6714..06a7cdec 100644
--- a/sandbox/009-sandbox-trace.mu
+++ b/sandbox/009-sandbox-trace.mu
@@ -14,7 +14,7 @@ scenario sandbox-click-on-code-toggles-app-trace [
     .                     run (F4)           .
     .                                        .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                       x.
+    .0                                      x.
     .stash [abc]                             .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                        .
@@ -33,7 +33,7 @@ scenario sandbox-click-on-code-toggles-app-trace [
     .                     run (F4)           .
     .␣                                       .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                       x.
+    .0                                      x.
     .stash [abc]                             .
     .abc                                     .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -62,7 +62,7 @@ scenario sandbox-click-on-code-toggles-app-trace [
     .                     run (F4)           .
     .␣                                       .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                       x.
+    .0                                      x.
     .stash [abc]                             .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                        .
@@ -84,7 +84,7 @@ add 2, 2]
     .                     run (F4)           .
     .                                        .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                       x.
+    .0                                      x.
     .stash [abc]                             .
     .add 2, 2                                .
     .4                                       .
@@ -103,7 +103,7 @@ add 2, 2]
     .                     run (F4)           .
     .                                        .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                       x.
+    .0                                      x.
     .stash [abc]                             .
     .add 2, 2                                .
     .abc                                     .
diff --git a/sandbox/010-warnings.mu b/sandbox/010-warnings.mu
index ff3a1598..16a6a92c 100644
--- a/sandbox/010-warnings.mu
+++ b/sandbox/010-warnings.mu
@@ -89,7 +89,7 @@ scenario run-instruction-and-print-warnings [
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .get 1:address:shared:point, 1:offset              .
     .first ingredient of 'get' should be a container, ↩.
     .but got 1:address:shared:point                    .
@@ -130,7 +130,7 @@ scenario run-instruction-and-print-warnings-only-once [
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .get 1234:number, foo:offset                       .
     .unknown element foo in container number           .
     .first ingredient of 'get' should be a container, ↩.
@@ -159,7 +159,7 @@ loop
     .                               run (F4)           .
     .                                                  .
     .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                 x.
+    .0                                                x.
     .{                                                 .
     .loop                                              .
     .}                                                 .