summaryrefslogtreecommitdiff
path: root/projects/09/K/Board.vm
diff options
context:
space:
mode:
authorYuchen Pei <me@ypei.me>2018-01-18 12:39:31 +0100
committerYuchen Pei <me@ypei.me>2018-01-18 12:39:31 +0100
commit3d08a3b370316d14ab6d08209566464853005474 (patch)
tree437878db2a20cef7142e1eddb27dee355f8437a6 /projects/09/K/Board.vm
parent84445f00a572497784fb6d97e23bdd1e655f6e5d (diff)
refactored K
- no more heap waste.
Diffstat (limited to 'projects/09/K/Board.vm')
-rw-r--r--projects/09/K/Board.vm30
1 files changed, 16 insertions, 14 deletions
diff --git a/projects/09/K/Board.vm b/projects/09/K/Board.vm
index ba236e1..985e813 100644
--- a/projects/09/K/Board.vm
+++ b/projects/09/K/Board.vm
@@ -167,6 +167,21 @@ call String.appendChar 2
push constant 33
call String.appendChar 2
pop static 3
+push constant 6
+call String.new 1
+push constant 84
+call String.appendChar 2
+push constant 117
+call String.appendChar 2
+push constant 114
+call String.appendChar 2
+push constant 110
+call String.appendChar 2
+push constant 58
+call String.appendChar 2
+push constant 32
+call String.appendChar 2
+pop static 5
push constant 0
return
function Board.initBoard 3
@@ -1429,20 +1444,7 @@ push constant 2
sub
call Output.moveCursor 2
pop temp 0
-push constant 6
-call String.new 1
-push constant 84
-call String.appendChar 2
-push constant 117
-call String.appendChar 2
-push constant 114
-call String.appendChar 2
-push constant 110
-call String.appendChar 2
-push constant 58
-call String.appendChar 2
-push constant 32
-call String.appendChar 2
+push static 5
call Output.printString 1
pop temp 0
push this 1