From 44b1636e2d84bd9cedb4b3272460f67033778939 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 25 Jul 2020 20:53:47 -0700 Subject: 6679 --- prototypes/tile/10.mu | 10 ++++------ prototypes/tile/5.mu | 2 +- prototypes/tile/6.mu | 2 +- prototypes/tile/7.mu | 2 +- prototypes/tile/8.mu | 2 +- prototypes/tile/9.mu | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) (limited to 'prototypes') diff --git a/prototypes/tile/10.mu b/prototypes/tile/10.mu index def5bc3f..a20e50ef 100644 --- a/prototypes/tile/10.mu +++ b/prototypes/tile/10.mu @@ -3,7 +3,7 @@ # To run (on Linux and x86): # $ git clone https://github.com/akkartik/mu # $ cd mu -# $ ./translate_mu prototypes/tile/4.mu +# $ ./translate_mu prototypes/tile/10.mu # $ ./a.elf # # Press 'c' to create new children for the root node, and keys to move: @@ -201,10 +201,10 @@ fn create-child node: (handle cell) { fn render root: (addr cell), cursor: (addr cell) { clear-screen var depth/eax: int <- tree-depth root - var viewport-width/ecx: int <- copy 0x64 # col2 + var viewport-width/ecx: int <- copy 0x65 # col2 viewport-width <- subtract 5 # col1 var column-width/eax: int <- try-divide viewport-width, depth - render-tree root, column-width, 5, 5, 0x20, 0x64, cursor + render-tree root, column-width, 5, 5, 0x20, 0x65, cursor } fn render-tree c: (addr cell), column-width: int, row-min: int, col-min: int, row-max: int, col-max: int, cursor: (addr cell) { @@ -306,13 +306,11 @@ fn draw-hatching row1: int, col1: int, row2: int, col2: int { var c/eax: int <- copy col1 var r1/ecx: int <- copy row1 r1 <- increment - var r2/edx: int <- copy row2 - r2 <- decrement c <- add 2 { compare c, col2 break-if->= - draw-vertical-line r1, r2, c + draw-vertical-line r1, row2, c c <- add 2 loop } diff --git a/prototypes/tile/5.mu b/prototypes/tile/5.mu index cf746806..c7785df6 100644 --- a/prototypes/tile/5.mu +++ b/prototypes/tile/5.mu @@ -3,7 +3,7 @@ # To run (on Linux and x86): # $ git clone https://github.com/akkartik/mu # $ cd mu -# $ ./translate_mu prototypes/tile/4.mu +# $ ./translate_mu prototypes/tile/5.mu # $ ./a.elf # # You should see a single rectangle representing a singleton tree node. diff --git a/prototypes/tile/6.mu b/prototypes/tile/6.mu index 4c05a824..4cf1d4c2 100644 --- a/prototypes/tile/6.mu +++ b/prototypes/tile/6.mu @@ -3,7 +3,7 @@ # To run (on Linux and x86): # $ git clone https://github.com/akkartik/mu # $ cd mu -# $ ./translate_mu prototypes/tile/4.mu +# $ ./translate_mu prototypes/tile/6.mu # $ ./a.elf # # Every time you press a key, a deeper tree is rendered. Press ctrl-c to exit. diff --git a/prototypes/tile/7.mu b/prototypes/tile/7.mu index 6c20c3c4..3cec67b6 100644 --- a/prototypes/tile/7.mu +++ b/prototypes/tile/7.mu @@ -3,7 +3,7 @@ # To run (on Linux and x86): # $ git clone https://github.com/akkartik/mu # $ cd mu -# $ ./translate_mu prototypes/tile/4.mu +# $ ./translate_mu prototypes/tile/7.mu # $ ./a.elf # # Every time you press a key, the root node gains another child. Press ctrl-c diff --git a/prototypes/tile/8.mu b/prototypes/tile/8.mu index 7a17cc34..9b7df0f8 100644 --- a/prototypes/tile/8.mu +++ b/prototypes/tile/8.mu @@ -3,7 +3,7 @@ # To run (on Linux and x86): # $ git clone https://github.com/akkartik/mu # $ cd mu -# $ ./translate_mu prototypes/tile/4.mu +# $ ./translate_mu prototypes/tile/8.mu # $ ./a.elf # # Every time you press a key, the root node gains another child. Press ctrl-c diff --git a/prototypes/tile/9.mu b/prototypes/tile/9.mu index 7b8d2d1b..91637afb 100644 --- a/prototypes/tile/9.mu +++ b/prototypes/tile/9.mu @@ -4,7 +4,7 @@ # To run (on Linux and x86): # $ git clone https://github.com/akkartik/mu # $ cd mu -# $ ./translate_mu prototypes/tile/4.mu +# $ ./translate_mu prototypes/tile/9.mu # $ ./a.elf # # Press 'c' to create new children for the root node. -- cgit 1.4.1-2-gfad0