about summary refs log tree commit diff stats
path: root/prototypes
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-07-16 21:38:40 -0700
committerKartik Agaram <vc@akkartik.com>2020-07-16 21:38:40 -0700
commite5f9d8123acd754662f723bdd5838eff74c56d48 (patch)
tree9f508b28721e940cd88a26e4a4651a4011edde8d /prototypes
parent93c94c6feef50033689756e0c40e20ab538ff360 (diff)
downloadmu-e5f9d8123acd754662f723bdd5838eff74c56d48.tar.gz
6653 - render deeper trees with a single child
Every time you press a key the depth increases by 1, and then the tree
re-renders.
Diffstat (limited to 'prototypes')
-rw-r--r--prototypes/tile/5.mu16
1 files changed, 14 insertions, 2 deletions
diff --git a/prototypes/tile/5.mu b/prototypes/tile/5.mu
index a3eac3bf..f2ea4c6b 100644
--- a/prototypes/tile/5.mu
+++ b/prototypes/tile/5.mu
@@ -64,9 +64,21 @@ $main:loop: {
 #######################################################
 
 fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) {
-  var c1/eax: (addr handle cell) <- copy cursor
+  # increase depth by 1
+  var c1/ecx: (addr handle cell) <- copy cursor
   var c2/eax: (addr cell) <- lookup *c1
-  create-child c2
+  var c3/edx: (addr cell) <- copy c2
+  {
+    print-string-to-screen "iter\n"
+    var tmp/ebx: (addr handle cell) <- get c3, first-child
+    var tmp2/eax: (addr cell) <- lookup *tmp
+    compare tmp2, 0
+    break-if-=
+    c1 <- copy tmp
+    c3 <- copy tmp2
+    loop
+  }
+  create-child c3
 }
 
 fn create-child node: (addr cell) {