Skip to content

Commit

Permalink
6653 - render deeper trees with a single child
Browse files Browse the repository at this point in the history
Every time you press a key the depth increases by 1, and then the tree
re-renders.
  • Loading branch information
akkartik committed Jul 17, 2020
1 parent 93c94c6 commit e5f9d81
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions prototypes/tile/5.mu
Expand Up @@ -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) {
Expand Down

0 comments on commit e5f9d81

Please sign in to comment.