aboutsummaryrefslogtreecommitdiff
path: root/projects/10
diff options
context:
space:
mode:
Diffstat (limited to 'projects/10')
-rw-r--r--projects/10/.gitignore1
-rw-r--r--projects/10/ArrayTest/Main.ast1
-rw-r--r--projects/10/ArrayTest/Main.jack38
-rw-r--r--projects/10/ArrayTest/Main.xml286
-rw-r--r--projects/10/ArrayTest/MainT.xml142
-rw-r--r--projects/10/ExpressionLessSquare/Main.ast1
-rw-r--r--projects/10/ExpressionLessSquare/Main.jack36
-rw-r--r--projects/10/ExpressionLessSquare/Main.xml205
-rw-r--r--projects/10/ExpressionLessSquare/MainT.xml109
-rw-r--r--projects/10/ExpressionLessSquare/Square.ast1
-rw-r--r--projects/10/ExpressionLessSquare/Square.jack99
-rw-r--r--projects/10/ExpressionLessSquare/Square.xml967
-rw-r--r--projects/10/ExpressionLessSquare/SquareGame.ast1
-rw-r--r--projects/10/ExpressionLessSquare/SquareGame.jack60
-rw-r--r--projects/10/ExpressionLessSquare/SquareGame.xml544
-rw-r--r--projects/10/ExpressionLessSquare/SquareGameT.xml268
-rw-r--r--projects/10/ExpressionLessSquare/SquareT.xml449
-rwxr-xr-xprojects/10/JackParserbin206568 -> 0 bytes
-rw-r--r--projects/10/JackParser.hibin9897 -> 0 bytes
-rw-r--r--projects/10/JackParser.hs312
-rw-r--r--projects/10/JackParser.obin299112 -> 0 bytes
-rw-r--r--projects/10/Square/Main.ast1
-rw-r--r--projects/10/Square/Main.jack36
-rw-r--r--projects/10/Square/Main.xml244
-rw-r--r--projects/10/Square/MainT.xml126
-rw-r--r--projects/10/Square/Square.ast1
-rw-r--r--projects/10/Square/Square.jack110
-rw-r--r--projects/10/Square/Square.xml1211
-rw-r--r--projects/10/Square/SquareGame.ast1
-rw-r--r--projects/10/Square/SquareGame.jack81
-rw-r--r--projects/10/Square/SquareGame.xml643
-rw-r--r--projects/10/Square/SquareGameT.xml315
-rw-r--r--projects/10/Square/SquareT.xml561
-rw-r--r--projects/10/jackspec.wiki3
-rw-r--r--projects/10/spec10
-rw-r--r--projects/10/spec1.pngbin224788 -> 0 bytes
-rw-r--r--projects/10/spec2.pngbin152598 -> 0 bytes
-rw-r--r--projects/10/test/Main.ast1
-rw-r--r--projects/10/test/Main.jack30
39 files changed, 0 insertions, 6884 deletions
diff --git a/projects/10/.gitignore b/projects/10/.gitignore
deleted file mode 100644
index 1377554..0000000
--- a/projects/10/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.swp
diff --git a/projects/10/ArrayTest/Main.ast b/projects/10/ArrayTest/Main.ast
deleted file mode 100644
index f8194cb..0000000
--- a/projects/10/ArrayTest/Main.ast
+++ /dev/null
@@ -1 +0,0 @@
-Right (JClass "Main" [] [JSubroutineDec (JSubroutineHeader "function" ("void","main") []) (JSubroutineBody [("Array","a"),("int","length"),("int","i"),("int","sum")] [JLetStatment (JVarId "length" Nothing) (JExpCall (JSubroutineCall "Keyboard" (Just "readInt") [JStrConst "HOW MANY NUMBERS? "])),JLetStatment (JVarId "a" Nothing) (JExpCall (JSubroutineCall "Array" (Just "new") [JExpVar (JVarId "length" Nothing)])),JLetStatment (JVarId "i" Nothing) (JIntConst 0),JWhileStatment (JExpBin (JExpVar (JVarId "i" Nothing)) [('<',JExpVar (JVarId "length" Nothing))]) [JLetStatment (JVarId "a" (Just (JExpVar (JVarId "i" Nothing)))) (JExpCall (JSubroutineCall "Keyboard" (Just "readInt") [JStrConst "ENTER THE NEXT NUMBER: "])),JLetStatment (JVarId "i" Nothing) (JExpBin (JExpVar (JVarId "i" Nothing)) [('+',JIntConst 1)])],JLetStatment (JVarId "i" Nothing) (JIntConst 0),JLetStatment (JVarId "sum" Nothing) (JIntConst 0),JWhileStatment (JExpBin (JExpVar (JVarId "i" Nothing)) [('<',JExpVar (JVarId "length" Nothing))]) [JLetStatment (JVarId "sum" Nothing) (JExpBin (JExpVar (JVarId "sum" Nothing)) [('+',JExpVar (JVarId "a" (Just (JExpVar (JVarId "i" Nothing)))))]),JLetStatment (JVarId "i" Nothing) (JExpBin (JExpVar (JVarId "i" Nothing)) [('+',JIntConst 1)])],JDoStatement (JSubroutineCall "Output" (Just "printString") [JStrConst "THE AVERAGE IS: "]),JDoStatement (JSubroutineCall "Output" (Just "printInt") [JExpBin (JExpVar (JVarId "sum" Nothing)) [('/',JExpVar (JVarId "length" Nothing))]]),JDoStatement (JSubroutineCall "Output" (Just "println") []),JReturnStatement Nothing])]) \ No newline at end of file
diff --git a/projects/10/ArrayTest/Main.jack b/projects/10/ArrayTest/Main.jack
deleted file mode 100644
index aa237b1..0000000
--- a/projects/10/ArrayTest/Main.jack
+++ /dev/null
@@ -1,38 +0,0 @@
-// This file is part of www.nand2tetris.org
-// and the book "The Elements of Computing Systems"
-// by Nisan and Schocken, MIT Press.
-// File name: projects/10/ArrayTest/Main.jack
-
-// (identical to projects/09/Average/Main.jack)
-
-/** Computes the average of a sequence of integers. */
-class Main {
- function void main() {
- var Array a;
- var int length;
- var int i, sum;
-
- let length = Keyboard.readInt("HOW MANY NUMBERS? ");
- let a = Array.new(length);
- let i = 0;
-
- while (i < length) {
- let a[i] = Keyboard.readInt("ENTER THE NEXT NUMBER: ");
- let i = i + 1;
- }
-
- let i = 0;
- let sum = 0;
-
- while (i < length) {
- let sum = sum + a[i];
- let i = i + 1;
- }
-
- do Output.printString("THE AVERAGE IS: ");
- do Output.printInt(sum / length);
- do Output.println();
-
- return;
- }
-}
diff --git a/projects/10/ArrayTest/Main.xml b/projects/10/ArrayTest/Main.xml
deleted file mode 100644
index 0ea96df..0000000
--- a/projects/10/ArrayTest/Main.xml
+++ /dev/null
@@ -1,286 +0,0 @@
-<class>
- <keyword> class </keyword>
- <identifier> Main </identifier>
- <symbol> { </symbol>
- <subroutineDec>
- <keyword> function </keyword>
- <keyword> void </keyword>
- <identifier> main </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <varDec>
- <keyword> var </keyword>
- <identifier> Array </identifier>
- <identifier> a </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <keyword> int </keyword>
- <identifier> length </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <keyword> int </keyword>
- <identifier> i </identifier>
- <symbol> , </symbol>
- <identifier> sum </identifier>
- <symbol> ; </symbol>
- </varDec>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> length </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Keyboard </identifier>
- <symbol> . </symbol>
- <identifier> readInt </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <stringConstant> HOW MANY NUMBERS? </stringConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> a </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Array </identifier>
- <symbol> . </symbol>
- <identifier> new </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> length </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> &lt; </symbol>
- <term>
- <identifier> length </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> a </identifier>
- <symbol> [ </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- </expression>
- <symbol> ] </symbol>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Keyboard </identifier>
- <symbol> . </symbol>
- <identifier> readInt </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <stringConstant> ENTER THE NEXT NUMBER: </stringConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> sum </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> &lt; </symbol>
- <term>
- <identifier> length </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> sum </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> sum </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> a </identifier>
- <symbol> [ </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- </expression>
- <symbol> ] </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Output </identifier>
- <symbol> . </symbol>
- <identifier> printString </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <stringConstant> THE AVERAGE IS: </stringConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Output </identifier>
- <symbol> . </symbol>
- <identifier> printInt </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> sum </identifier>
- </term>
- <symbol> / </symbol>
- <term>
- <identifier> length </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Output </identifier>
- <symbol> . </symbol>
- <identifier> println </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <symbol> } </symbol>
-</class>
diff --git a/projects/10/ArrayTest/MainT.xml b/projects/10/ArrayTest/MainT.xml
deleted file mode 100644
index 68721ec..0000000
--- a/projects/10/ArrayTest/MainT.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<tokens>
-<keyword> class </keyword>
-<identifier> Main </identifier>
-<symbol> { </symbol>
-<keyword> function </keyword>
-<keyword> void </keyword>
-<identifier> main </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> var </keyword>
-<identifier> Array </identifier>
-<identifier> a </identifier>
-<symbol> ; </symbol>
-<keyword> var </keyword>
-<keyword> int </keyword>
-<identifier> length </identifier>
-<symbol> ; </symbol>
-<keyword> var </keyword>
-<keyword> int </keyword>
-<identifier> i </identifier>
-<symbol> , </symbol>
-<identifier> sum </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> length </identifier>
-<symbol> = </symbol>
-<identifier> Keyboard </identifier>
-<symbol> . </symbol>
-<identifier> readInt </identifier>
-<symbol> ( </symbol>
-<stringConstant> HOW MANY NUMBERS? </stringConstant>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> a </identifier>
-<symbol> = </symbol>
-<identifier> Array </identifier>
-<symbol> . </symbol>
-<identifier> new </identifier>
-<symbol> ( </symbol>
-<identifier> length </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> i </identifier>
-<symbol> = </symbol>
-<integerConstant> 0 </integerConstant>
-<symbol> ; </symbol>
-<keyword> while </keyword>
-<symbol> ( </symbol>
-<identifier> i </identifier>
-<symbol> &lt; </symbol>
-<identifier> length </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> a </identifier>
-<symbol> [ </symbol>
-<identifier> i </identifier>
-<symbol> ] </symbol>
-<symbol> = </symbol>
-<identifier> Keyboard </identifier>
-<symbol> . </symbol>
-<identifier> readInt </identifier>
-<symbol> ( </symbol>
-<stringConstant> ENTER THE NEXT NUMBER: </stringConstant>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> i </identifier>
-<symbol> = </symbol>
-<identifier> i </identifier>
-<symbol> + </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> let </keyword>
-<identifier> i </identifier>
-<symbol> = </symbol>
-<integerConstant> 0 </integerConstant>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> sum </identifier>
-<symbol> = </symbol>
-<integerConstant> 0 </integerConstant>
-<symbol> ; </symbol>
-<keyword> while </keyword>
-<symbol> ( </symbol>
-<identifier> i </identifier>
-<symbol> &lt; </symbol>
-<identifier> length </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> sum </identifier>
-<symbol> = </symbol>
-<identifier> sum </identifier>
-<symbol> + </symbol>
-<identifier> a </identifier>
-<symbol> [ </symbol>
-<identifier> i </identifier>
-<symbol> ] </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> i </identifier>
-<symbol> = </symbol>
-<identifier> i </identifier>
-<symbol> + </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> do </keyword>
-<identifier> Output </identifier>
-<symbol> . </symbol>
-<identifier> printString </identifier>
-<symbol> ( </symbol>
-<stringConstant> THE AVERAGE IS: </stringConstant>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Output </identifier>
-<symbol> . </symbol>
-<identifier> printInt </identifier>
-<symbol> ( </symbol>
-<identifier> sum </identifier>
-<symbol> / </symbol>
-<identifier> length </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Output </identifier>
-<symbol> . </symbol>
-<identifier> println </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-</tokens>
diff --git a/projects/10/ExpressionLessSquare/Main.ast b/projects/10/ExpressionLessSquare/Main.ast
deleted file mode 100644
index 57a44eb..0000000
--- a/projects/10/ExpressionLessSquare/Main.ast
+++ /dev/null
@@ -1 +0,0 @@
-Right (JClass "Main" [JClassVarDec "static" ("boolean","test")] [JSubroutineDec (JSubroutineHeader "function" ("void","main") []) (JSubroutineBody [("SquareGame","game")] [JLetStatment (JVarId "game" Nothing) (JExpVar (JVarId "game" Nothing)),JDoStatement (JSubroutineCall "game" (Just "run") []),JDoStatement (JSubroutineCall "game" (Just "dispose") []),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "function" ("void","test") []) (JSubroutineBody [("int","i"),("int","j"),("String","s"),("Array","a")] [JIfStatement (JExpVar (JVarId "i" Nothing)) [JLetStatment (JVarId "s" Nothing) (JExpVar (JVarId "i" Nothing)),JLetStatment (JVarId "s" Nothing) (JExpVar (JVarId "j" Nothing)),JLetStatment (JVarId "a" (Just (JExpVar (JVarId "i" Nothing)))) (JExpVar (JVarId "j" Nothing))] (Just [JLetStatment (JVarId "i" Nothing) (JExpVar (JVarId "i" Nothing)),JLetStatment (JVarId "j" Nothing) (JExpVar (JVarId "j" Nothing)),JLetStatment (JVarId "i" Nothing) (JExpBin (JExpVar (JVarId "i" Nothing)) [('|',JExpVar (JVarId "j" Nothing))])]),JReturnStatement Nothing])]) \ No newline at end of file
diff --git a/projects/10/ExpressionLessSquare/Main.jack b/projects/10/ExpressionLessSquare/Main.jack
deleted file mode 100644
index d2c5561..0000000
--- a/projects/10/ExpressionLessSquare/Main.jack
+++ /dev/null
@@ -1,36 +0,0 @@
-// This file is part of www.nand2tetris.org
-// and the book "The Elements of Computing Systems"
-// by Nisan and Schocken, MIT Press.
-// File name: projects/10/ExpressionLessSquare/Main.jack
-
-/** Expressionless version of projects/10/Square/Main.jack. */
-
-class Main {
- static boolean test; // Added for testing -- there is no static keyword
- // in the Square files.
-
- function void main() {
- var SquareGame game;
- let game = game;
- do game.run();
- do game.dispose();
- return;
- }
-
- function void test() { // Added to test Jack syntax that is not use in
- var int i, j; // the Square files.
- var String s;
- var Array a;
- if (i) {
- let s = i;
- let s = j;
- let a[i] = j;
- }
- else { // There is no else keyword in the Square files.
- let i = i;
- let j = j;
- let i = i | j;
- }
- return;
- }
-}
diff --git a/projects/10/ExpressionLessSquare/Main.xml b/projects/10/ExpressionLessSquare/Main.xml
deleted file mode 100644
index 6beb694..0000000
--- a/projects/10/ExpressionLessSquare/Main.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-<class>
- <keyword> class </keyword>
- <identifier> Main </identifier>
- <symbol> { </symbol>
- <classVarDec>
- <keyword> static </keyword>
- <keyword> boolean </keyword>
- <identifier> test </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <subroutineDec>
- <keyword> function </keyword>
- <keyword> void </keyword>
- <identifier> main </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <varDec>
- <keyword> var </keyword>
- <identifier> SquareGame </identifier>
- <identifier> game </identifier>
- <symbol> ; </symbol>
- </varDec>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> game </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> game </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> game </identifier>
- <symbol> . </symbol>
- <identifier> run </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> game </identifier>
- <symbol> . </symbol>
- <identifier> dispose </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> function </keyword>
- <keyword> void </keyword>
- <identifier> test </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <varDec>
- <keyword> var </keyword>
- <keyword> int </keyword>
- <identifier> i </identifier>
- <symbol> , </symbol>
- <identifier> j </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <identifier> String </identifier>
- <identifier> s </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <identifier> Array </identifier>
- <identifier> a </identifier>
- <symbol> ; </symbol>
- </varDec>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> s </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> s </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> j </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> a </identifier>
- <symbol> [ </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- </expression>
- <symbol> ] </symbol>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> j </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- <keyword> else </keyword>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> j </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> j </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> | </symbol>
- <term>
- <identifier> j </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <symbol> } </symbol>
-</class>
diff --git a/projects/10/ExpressionLessSquare/MainT.xml b/projects/10/ExpressionLessSquare/MainT.xml
deleted file mode 100644
index f074ba4..0000000
--- a/projects/10/ExpressionLessSquare/MainT.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<tokens>
-<keyword> class </keyword>
-<identifier> Main </identifier>
-<symbol> { </symbol>
-<keyword> static </keyword>
-<keyword> boolean </keyword>
-<identifier> test </identifier>
-<symbol> ; </symbol>
-<keyword> function </keyword>
-<keyword> void </keyword>
-<identifier> main </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> var </keyword>
-<identifier> SquareGame </identifier>
-<identifier> game </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> game </identifier>
-<symbol> = </symbol>
-<identifier> game </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> game </identifier>
-<symbol> . </symbol>
-<identifier> run </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> game </identifier>
-<symbol> . </symbol>
-<identifier> dispose </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> function </keyword>
-<keyword> void </keyword>
-<identifier> test </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> var </keyword>
-<keyword> int </keyword>
-<identifier> i </identifier>
-<symbol> , </symbol>
-<identifier> j </identifier>
-<symbol> ; </symbol>
-<keyword> var </keyword>
-<identifier> String </identifier>
-<identifier> s </identifier>
-<symbol> ; </symbol>
-<keyword> var </keyword>
-<identifier> Array </identifier>
-<identifier> a </identifier>
-<symbol> ; </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> i </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> s </identifier>
-<symbol> = </symbol>
-<identifier> i </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> s </identifier>
-<symbol> = </symbol>
-<identifier> j </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> a </identifier>
-<symbol> [ </symbol>
-<identifier> i </identifier>
-<symbol> ] </symbol>
-<symbol> = </symbol>
-<identifier> j </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> else </keyword>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> i </identifier>
-<symbol> = </symbol>
-<identifier> i </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> j </identifier>
-<symbol> = </symbol>
-<identifier> j </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> i </identifier>
-<symbol> = </symbol>
-<identifier> i </identifier>
-<symbol> | </symbol>
-<identifier> j </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-</tokens>
diff --git a/projects/10/ExpressionLessSquare/Square.ast b/projects/10/ExpressionLessSquare/Square.ast
deleted file mode 100644
index 884c695..0000000
--- a/projects/10/ExpressionLessSquare/Square.ast
+++ /dev/null
@@ -1 +0,0 @@
-Right (JClass "Square" [JClassVarDec "field" ("int","x"),JClassVarDec "field" ("int","y"),JClassVarDec "field" ("int","size")] [JSubroutineDec (JSubroutineHeader "constructor" ("Square","new") [("int","Ax"),("int","Ay"),("int","Asize")]) (JSubroutineBody [] [JLetStatment (JVarId "x" Nothing) (JExpVar (JVarId "Ax" Nothing)),JLetStatment (JVarId "y" Nothing) (JExpVar (JVarId "Ay" Nothing)),JLetStatment (JVarId "size" Nothing) (JExpVar (JVarId "Asize" Nothing)),JDoStatement (JSubroutineCall "draw" Nothing []),JReturnStatement (Just (JExpVar (JVarId "x" Nothing)))]),JSubroutineDec (JSubroutineHeader "method" ("void","dispose") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "Memory" (Just "deAlloc") [JKeywordConst "this"]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","draw") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","erase") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","incSize") []) (JSubroutineBody [] [JIfStatement (JExpVar (JVarId "x" Nothing)) [JDoStatement (JSubroutineCall "erase" Nothing []),JLetStatment (JVarId "size" Nothing) (JExpVar (JVarId "size" Nothing)),JDoStatement (JSubroutineCall "draw" Nothing [])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","decSize") []) (JSubroutineBody [] [JIfStatement (JExpVar (JVarId "size" Nothing)) [JDoStatement (JSubroutineCall "erase" Nothing []),JLetStatment (JVarId "size" Nothing) (JExpVar (JVarId "size" Nothing)),JDoStatement (JSubroutineCall "draw" Nothing [])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveUp") []) (JSubroutineBody [] [JIfStatement (JExpVar (JVarId "y" Nothing)) [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)]),JLetStatment (JVarId "y" Nothing) (JExpVar (JVarId "y" Nothing)),JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveDown") []) (JSubroutineBody [] [JIfStatement (JExpVar (JVarId "y" Nothing)) [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)]),JLetStatment (JVarId "y" Nothing) (JExpVar (JVarId "y" Nothing)),JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveLeft") []) (JSubroutineBody [] [JIfStatement (JExpVar (JVarId "x" Nothing)) [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)]),JLetStatment (JVarId "x" Nothing) (JExpVar (JVarId "x" Nothing)),JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveRight") []) (JSubroutineBody [] [JIfStatement (JExpVar (JVarId "x" Nothing)) [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)]),JLetStatment (JVarId "x" Nothing) (JExpVar (JVarId "x" Nothing)),JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JExpVar (JVarId "x" Nothing)]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing)])] Nothing,JReturnStatement Nothing])]) \ No newline at end of file
diff --git a/projects/10/ExpressionLessSquare/Square.jack b/projects/10/ExpressionLessSquare/Square.jack
deleted file mode 100644
index 33a54ad..0000000
--- a/projects/10/ExpressionLessSquare/Square.jack
+++ /dev/null
@@ -1,99 +0,0 @@
-// This file is part of www.nand2tetris.org
-// and the book "The Elements of Computing Systems"
-// by Nisan and Schocken, MIT Press.
-/// File name: projects/10/ExpressionLessSquare/Square.jack
-
-/** Expressionless version of projects/10/Square/Square.jack. */
-
-class Square {
-
- field int x, y;
- field int size;
-
- constructor Square new(int Ax, int Ay, int Asize) {
- let x = Ax;
- let y = Ay;
- let size = Asize;
- do draw();
- return x;
- }
-
- method void dispose() {
- do Memory.deAlloc(this);
- return;
- }
-
- method void draw() {
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- return;
- }
-
- method void erase() {
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- return;
- }
-
- method void incSize() {
- if (x) {
- do erase();
- let size = size;
- do draw();
- }
- return;
- }
-
- method void decSize() {
- if (size) {
- do erase();
- let size = size;
- do draw();
- }
- return;
- }
-
- method void moveUp() {
- if (y) {
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- let y = y;
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- }
- return;
- }
-
- method void moveDown() {
- if (y) {
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- let y = y;
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- }
- return;
- }
-
- method void moveLeft() {
- if (x) {
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- let x = x;
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- }
- return;
- }
-
- method void moveRight() {
- if (x) {
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- let x = x;
- do Screen.setColor(x);
- do Screen.drawRectangle(x, y, x, y);
- }
- return;
- }
-}
diff --git a/projects/10/ExpressionLessSquare/Square.xml b/projects/10/ExpressionLessSquare/Square.xml
deleted file mode 100644
index ed0e6ec..0000000
--- a/projects/10/ExpressionLessSquare/Square.xml
+++ /dev/null
@@ -1,967 +0,0 @@
-<class>
- <keyword> class </keyword>
- <identifier> Square </identifier>
- <symbol> { </symbol>
- <classVarDec>
- <keyword> field </keyword>
- <keyword> int </keyword>
- <identifier> x </identifier>
- <symbol> , </symbol>
- <identifier> y </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <classVarDec>
- <keyword> field </keyword>
- <keyword> int </keyword>
- <identifier> size </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <subroutineDec>
- <keyword> constructor </keyword>
- <identifier> Square </identifier>
- <identifier> new </identifier>
- <symbol> ( </symbol>
- <parameterList>
- <keyword> int </keyword>
- <identifier> Ax </identifier>
- <symbol> , </symbol>
- <keyword> int </keyword>
- <identifier> Ay </identifier>
- <symbol> , </symbol>
- <keyword> int </keyword>
- <identifier> Asize </identifier>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> x </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Ax </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> y </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Ay </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> size </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Asize </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> draw </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> dispose </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Memory </identifier>
- <symbol> . </symbol>
- <identifier> deAlloc </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> this </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> draw </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> erase </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> incSize </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> erase </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> size </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> draw </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> decSize </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> erase </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> size </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> draw </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveUp </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> y </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveDown </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> y </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveLeft </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> x </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveRight </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> x </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <symbol> } </symbol>
-</class>
diff --git a/projects/10/ExpressionLessSquare/SquareGame.ast b/projects/10/ExpressionLessSquare/SquareGame.ast
deleted file mode 100644
index 0abe80b..0000000
--- a/projects/10/ExpressionLessSquare/SquareGame.ast
+++ /dev/null
@@ -1 +0,0 @@
-Right (JClass "SquareGame" [JClassVarDec "field" ("Square","square"),JClassVarDec "field" ("int","direction")] [JSubroutineDec (JSubroutineHeader "constructor" ("SquareGame","new") []) (JSubroutineBody [] [JLetStatment (JVarId "square" Nothing) (JExpVar (JVarId "square" Nothing)),JLetStatment (JVarId "direction" Nothing) (JExpVar (JVarId "direction" Nothing)),JReturnStatement (Just (JExpVar (JVarId "square" Nothing)))]),JSubroutineDec (JSubroutineHeader "method" ("void","dispose") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "square" (Just "dispose") []),JDoStatement (JSubroutineCall "Memory" (Just "deAlloc") [JExpVar (JVarId "square" Nothing)]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveSquare") []) (JSubroutineBody [] [JIfStatement (JExpVar (JVarId "direction" Nothing)) [JDoStatement (JSubroutineCall "square" (Just "moveUp") [])] Nothing,JIfStatement (JExpVar (JVarId "direction" Nothing)) [JDoStatement (JSubroutineCall "square" (Just "moveDown") [])] Nothing,JIfStatement (JExpVar (JVarId "direction" Nothing)) [JDoStatement (JSubroutineCall "square" (Just "moveLeft") [])] Nothing,JIfStatement (JExpVar (JVarId "direction" Nothing)) [JDoStatement (JSubroutineCall "square" (Just "moveRight") [])] Nothing,JDoStatement (JSubroutineCall "Sys" (Just "wait") [JExpVar (JVarId "direction" Nothing)]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","run") []) (JSubroutineBody [("char","key"),("boolean","exit")] [JLetStatment (JVarId "exit" Nothing) (JExpVar (JVarId "key" Nothing)),JWhileStatment (JExpVar (JVarId "exit" Nothing)) [JWhileStatment (JExpVar (JVarId "key" Nothing)) [JLetStatment (JVarId "key" Nothing) (JExpVar (JVarId "key" Nothing)),JDoStatement (JSubroutineCall "moveSquare" Nothing [])],JIfStatement (JExpVar (JVarId "key" Nothing)) [JLetStatment (JVarId "exit" Nothing) (JExpVar (JVarId "exit" Nothing))] Nothing,JIfStatement (JExpVar (JVarId "key" Nothing)) [JDoStatement (JSubroutineCall "square" (Just "decSize") [])] Nothing,JIfStatement (JExpVar (JVarId "key" Nothing)) [JDoStatement (JSubroutineCall "square" (Just "incSize") [])] Nothing,JIfStatement (JExpVar (JVarId "key" Nothing)) [JLetStatment (JVarId "direction" Nothing) (JExpVar (JVarId "exit" Nothing))] Nothing,JIfStatement (JExpVar (JVarId "key" Nothing)) [JLetStatment (JVarId "direction" Nothing) (JExpVar (JVarId "key" Nothing))] Nothing,JIfStatement (JExpVar (JVarId "key" Nothing)) [JLetStatment (JVarId "direction" Nothing) (JExpVar (JVarId "square" Nothing))] Nothing,JIfStatement (JExpVar (JVarId "key" Nothing)) [JLetStatment (JVarId "direction" Nothing) (JExpVar (JVarId "direction" Nothing))] Nothing,JWhileStatment (JExpVar (JVarId "key" Nothing)) [JLetStatment (JVarId "key" Nothing) (JExpVar (JVarId "key" Nothing)),JDoStatement (JSubroutineCall "moveSquare" Nothing [])]],JReturnStatement Nothing])]) \ No newline at end of file
diff --git a/projects/10/ExpressionLessSquare/SquareGame.jack b/projects/10/ExpressionLessSquare/SquareGame.jack
deleted file mode 100644
index 2866f0d..0000000
--- a/projects/10/ExpressionLessSquare/SquareGame.jack
+++ /dev/null
@@ -1,60 +0,0 @@
-// This file is part of www.nand2tetris.org
-// and the book "The Elements of Computing Systems"
-// by Nisan and Schocken, MIT Press.
-// File name: projects/10/ExpressionLessSquare/SquareGame.jack
-
-/** Expressionless version of projects/10/Square/SquareGame.jack. */
-
-class SquareGame {
- field Square square;
- field int direction;
-
- constructor SquareGame new() {
- let square = square;
- let direction = direction;
- return square;
- }
-
- method void dispose() {
- do square.dispose();
- do Memory.deAlloc(square);
- return;
- }
-
- method void moveSquare() {
- if (direction) { do square.moveUp(); }
- if (direction) { do square.moveDown(); }
- if (direction) { do square.moveLeft(); }
- if (direction) { do square.moveRight(); }
- do Sys.wait(direction);
- return;
- }
-
- method void run() {
- var char key;
- var boolean exit;
-
- let exit = key;
- while (exit) {
- while (key) {
- let key = key;
- do moveSquare();
- }
-
- if (key) { let exit = exit; }
- if (key) { do square.decSize(); }
- if (key) { do square.incSize(); }
- if (key) { let direction = exit; }
- if (key) { let direction = key; }
- if (key) { let direction = square; }
- if (key) { let direction = direction; }
-
- while (key) {
- let key = key;
- do moveSquare();
- }
- }
- return;
- }
-}
-
diff --git a/projects/10/ExpressionLessSquare/SquareGame.xml b/projects/10/ExpressionLessSquare/SquareGame.xml
deleted file mode 100644
index 288c6cd..0000000
--- a/projects/10/ExpressionLessSquare/SquareGame.xml
+++ /dev/null
@@ -1,544 +0,0 @@
-<class>
- <keyword> class </keyword>
- <identifier> SquareGame </identifier>
- <symbol> { </symbol>
- <classVarDec>
- <keyword> field </keyword>
- <identifier> Square </identifier>
- <identifier> square </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <classVarDec>
- <keyword> field </keyword>
- <keyword> int </keyword>
- <identifier> direction </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <subroutineDec>
- <keyword> constructor </keyword>
- <identifier> SquareGame </identifier>
- <identifier> new </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> square </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> square </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <returnStatement>
- <keyword> return </keyword>
- <expression>
- <term>
- <identifier> square </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> dispose </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> dispose </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Memory </identifier>
- <symbol> . </symbol>
- <identifier> deAlloc </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> square </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveSquare </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> moveUp </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> moveDown </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> moveLeft </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> moveRight </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Sys </identifier>
- <symbol> . </symbol>
- <identifier> wait </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> run </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <varDec>
- <keyword> var </keyword>
- <keyword> char </keyword>
- <identifier> key </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <keyword> boolean </keyword>
- <identifier> exit </identifier>
- <symbol> ; </symbol>
- </varDec>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> exit </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> exit </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> key </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> moveSquare </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> exit </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> exit </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> decSize </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> incSize </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> exit </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> square </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> key </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> moveSquare </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <symbol> } </symbol>
-</class>
diff --git a/projects/10/ExpressionLessSquare/SquareGameT.xml b/projects/10/ExpressionLessSquare/SquareGameT.xml
deleted file mode 100644
index 278a8a9..0000000
--- a/projects/10/ExpressionLessSquare/SquareGameT.xml
+++ /dev/null
@@ -1,268 +0,0 @@
-<tokens>
-<keyword> class </keyword>
-<identifier> SquareGame </identifier>
-<symbol> { </symbol>
-<keyword> field </keyword>
-<identifier> Square </identifier>
-<identifier> square </identifier>
-<symbol> ; </symbol>
-<keyword> field </keyword>
-<keyword> int </keyword>
-<identifier> direction </identifier>
-<symbol> ; </symbol>
-<keyword> constructor </keyword>
-<identifier> SquareGame </identifier>
-<identifier> new </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> square </identifier>
-<symbol> = </symbol>
-<identifier> square </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<identifier> direction </identifier>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<identifier> square </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> dispose </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> dispose </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Memory </identifier>
-<symbol> . </symbol>
-<identifier> deAlloc </identifier>
-<symbol> ( </symbol>
-<identifier> square </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveSquare </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> moveUp </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> moveDown </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> moveLeft </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> moveRight </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> do </keyword>
-<identifier> Sys </identifier>
-<symbol> . </symbol>
-<identifier> wait </identifier>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> run </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> var </keyword>
-<keyword> char </keyword>
-<identifier> key </identifier>
-<symbol> ; </symbol>
-<keyword> var </keyword>
-<keyword> boolean </keyword>
-<identifier> exit </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> exit </identifier>
-<symbol> = </symbol>
-<identifier> key </identifier>
-<symbol> ; </symbol>
-<keyword> while </keyword>
-<symbol> ( </symbol>
-<identifier> exit </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> while </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<identifier> key </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> moveSquare </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> exit </identifier>
-<symbol> = </symbol>
-<identifier> exit </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> decSize </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> incSize </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<identifier> exit </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<identifier> key </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<identifier> square </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<identifier> direction </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> while </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<identifier> key </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> moveSquare </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-</tokens>
diff --git a/projects/10/ExpressionLessSquare/SquareT.xml b/projects/10/ExpressionLessSquare/SquareT.xml
deleted file mode 100644
index cd03a1e..0000000
--- a/projects/10/ExpressionLessSquare/SquareT.xml
+++ /dev/null
@@ -1,449 +0,0 @@
-<tokens>
-<keyword> class </keyword>
-<identifier> Square </identifier>
-<symbol> { </symbol>
-<keyword> field </keyword>
-<keyword> int </keyword>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ; </symbol>
-<keyword> field </keyword>
-<keyword> int </keyword>
-<identifier> size </identifier>
-<symbol> ; </symbol>
-<keyword> constructor </keyword>
-<identifier> Square </identifier>
-<identifier> new </identifier>
-<symbol> ( </symbol>
-<keyword> int </keyword>
-<identifier> Ax </identifier>
-<symbol> , </symbol>
-<keyword> int </keyword>
-<identifier> Ay </identifier>
-<symbol> , </symbol>
-<keyword> int </keyword>
-<identifier> Asize </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> x </identifier>
-<symbol> = </symbol>
-<identifier> Ax </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> y </identifier>
-<symbol> = </symbol>
-<identifier> Ay </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> size </identifier>
-<symbol> = </symbol>
-<identifier> Asize </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> draw </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<identifier> x </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> dispose </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Memory </identifier>
-<symbol> . </symbol>
-<identifier> deAlloc </identifier>
-<symbol> ( </symbol>
-<keyword> this </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> draw </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> erase </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> incSize </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> erase </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> size </identifier>
-<symbol> = </symbol>
-<identifier> size </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> draw </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> decSize </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> erase </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> size </identifier>
-<symbol> = </symbol>
-<identifier> size </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> draw </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveUp </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> y </identifier>
-<symbol> = </symbol>
-<identifier> y </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveDown </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> y </identifier>
-<symbol> = </symbol>
-<identifier> y </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveLeft </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> x </identifier>
-<symbol> = </symbol>
-<identifier> x </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveRight </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> x </identifier>
-<symbol> = </symbol>
-<identifier> x </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-</tokens>
diff --git a/projects/10/JackParser b/projects/10/JackParser
deleted file mode 100755
index 7d36891..0000000
--- a/projects/10/JackParser
+++ /dev/null
Binary files differ
diff --git a/projects/10/JackParser.hi b/projects/10/JackParser.hi
deleted file mode 100644
index a0ca33e..0000000
--- a/projects/10/JackParser.hi
+++ /dev/null
Binary files differ
diff --git a/projects/10/JackParser.hs b/projects/10/JackParser.hs
deleted file mode 100644
index 6f83070..0000000
--- a/projects/10/JackParser.hs
+++ /dev/null
@@ -1,312 +0,0 @@
--- Jack Parser, as the coursework of Project 10 of Nand2Tetris course.
--- Author: Yuchen Pei (me@ypei.me)
--- Date: 2018-01-11
-{-# LANGUAGE FlexibleContexts #-}
-import Text.Parsec.Prim
-import Text.Parsec.Char
-import Text.Parsec.Combinator
-import Data.Functor.Identity
-import Data.Either
-import Data.Maybe
-import Data.List
-import System.Environment
-import System.Directory
-import Control.Monad
-
-data JClass = JClass JIdentifier [JClassVarDec] [JSubroutineDec] deriving (Show, Eq)
-data JClassVarDec = JClassVarDec JClassVarScope JTypeAndId deriving (Show, Eq)
-data JSubroutineDec = JSubroutineDec JSubroutineHeader JSubroutineBody deriving (Show, Eq)
-data JSubroutineHeader = JSubroutineHeader JSubroutineType JTypeAndId [JTypeAndId] deriving (Show, Eq)
-data JSubroutineBody = JSubroutineBody [JTypeAndId] [JStatement] deriving (Show, Eq)
-data JStatement = JLetStatment JVarId JExpression
- | JIfStatement JExpression [JStatement] (Maybe [JStatement])
- | JWhileStatment JExpression [JStatement]
- | JDoStatement JSubroutineCall
- | JReturnStatement (Maybe JExpression)
- deriving (Show, Eq)
-data JExpression = JIntConst Int
- | JStrConst [Char]
- | JKeywordConst [Char] -- can only be true, false, null or this
- | JExpVar JVarId
- | JExpCall JSubroutineCall
- | JExpUna JUOp JExpression -- JOp can only be - or ~ here
- | JExpBin JExpression [(JBOp, JExpression)]
- deriving (Show, Eq)
-data JVarId = JVarId JIdentifier (Maybe JExpression) deriving (Show, Eq)
-data JSubroutineCall = JSubroutineCall JIdentifier (Maybe JIdentifier) [JExpression] deriving (Show, Eq)
-type JBOp = Char
-type JUOp = Char
-type JIdentifier = [Char]
-type JTypeAndId = (JType, JIdentifier)
-type JClassVarScope = [Char]
-type JType = [Char]
-type JSubroutineType = [Char]
-type JackParser = Parsec [Char] ()
-
-
-binaryOpChars = "+-*/&|<>="
-unaryOpChars = "-~"
-keywordConstStrs = ["true", "false", "null", "this"]
-primTypeStrs = ["int", "char", "boolean"]
-primTypeStrs' = primTypeStrs ++ ["void"]
-classVarScopeStrs = ["static", "field"]
-subroutineTypeStrs = ["constructor", "function", "method"]
-alphaUnderscore = ['a' .. 'z'] ++ ['A' .. 'Z'] ++ ['_']
-alphaNumUnderscore = alphaUnderscore ++ ['0'..'9']
-
-parse' parser = parse parser ""
-
---jack xs = parse' (many jSpace >> jClass) (replCrWithNl xs)
-jack = parse' (many jSpace >> jClass)
-
-jClass :: JackParser JClass
-jClass = do
- string "class" >> many1 jSpace
- id <- jIdentifier
- many jSpace >> char '{'
- classVarDecs <- many $ try (many jSpace >> jClassVarDecs)
- subroutineDecs <- many $ try (many jSpace >> jSubroutineDec)
- many jSpace >> char '}'
- return $ JClass id (mconcat classVarDecs) subroutineDecs
-
-jClassType :: JackParser [Char]
-jClassType = do
- x <- oneOf ['A' .. 'Z']
- xs <- many $ oneOf alphaNumUnderscore
- return $ x:xs
-
-jBOp :: JackParser JBOp
-jBOp = oneOf binaryOpChars
-
-jUOp :: JackParser JUOp
-jUOp = oneOf unaryOpChars
-
-jComment :: JackParser ()
-jComment = jInlineComment <|> jBlockComment
-
-jInlineComment :: JackParser ()
-jInlineComment = return () <*
- try (string "//" >> manyTill (noneOf "\n\r") endOfLine)
- --try (string "//" >> manyTill (noneOf "\n") newline)
-
-jSpace :: JackParser ()
-jSpace = (return () <* space) <|> jComment
-
-jBlockComment :: JackParser ()
-jBlockComment = return () <*
- try (string "/*" >> manyTill anyChar (try $ string "*/"))
-
-jPrimType :: JackParser JType
-jPrimType = choice $ string <$> primTypeStrs
-
-jType :: JackParser JType
-jType = choice [jPrimType, jClassType]
-
-jPrimType' :: JackParser JType
-jPrimType' = choice $ string <$> primTypeStrs'
-
-jType' :: JackParser JType
-jType' = choice [jPrimType', jClassType]
-
-jClassVarScope :: JackParser JClassVarScope
-jClassVarScope = choice $ string <$> classVarScopeStrs
-
-jSubroutineType :: JackParser JSubroutineType
-jSubroutineType = choice $ string <$> subroutineTypeStrs
-
-jIdentifier :: JackParser [Char]
-jIdentifier = do
- x <- oneOf alphaUnderscore
- xs <- many $ oneOf alphaNumUnderscore
- return $ x:xs
-
-jClassVarDecs :: JackParser [JClassVarDec]
-jClassVarDecs = do
- scope <- jClassVarScope
- many1 jSpace
- typeAndIds <- jTypeAndIds
- many jSpace >> char ';'
- return $ JClassVarDec scope <$> typeAndIds
-
-jVarDecs :: JackParser [JTypeAndId]
-jVarDecs =
- (string "var" >> many1 jSpace) >> jTypeAndIds <* (many jSpace >> char ';')
-
-jTypeAndId :: JackParser JType -> JackParser JTypeAndId
-jTypeAndId p = do
- type_ <- p
- many1 jSpace
- id <- jIdentifier
- return (type_, id)
-
-jTypeAndIds :: JackParser [JTypeAndId]
-jTypeAndIds = do
- type_ <- jType
- many1 jSpace
- ids <- sepBy jIdentifier (try $ many jSpace >> char ',' >> many jSpace)
- return $ (\x -> (type_, x)) <$> ids
-
-jParameters :: JackParser [JTypeAndId]
-jParameters = do
- char '(' >> many jSpace
- params <- sepBy (jTypeAndId jType) (try $ many jSpace >> char ',' >> many jSpace)
- many jSpace >> char ')'
- return params
-
-jSubroutineHeader :: JackParser JSubroutineHeader
-jSubroutineHeader = do
- subtype <- jSubroutineType
- many1 jSpace
- typeAndId <- jTypeAndId jType'
- params <- jParameters
- return $ JSubroutineHeader subtype typeAndId params
-
-jExpression :: JackParser JExpression
-jExpression = jExpBin <|> jTerm
-
-jTerm :: JackParser JExpression
-jTerm = choice [jIntConst, jStrConst, jKeywordConst, jExpCall, jExpVar, jExpUna, jExpInBraces]
-
-jIntConst :: JackParser JExpression
-jIntConst = JIntConst <$> (read <$> many1 digit)
-
-jStrConst :: JackParser JExpression
-jStrConst = JStrConst <$> between (char '"') (char '"') (many $ noneOf "\"")
-
-jKeywordConst :: JackParser JExpression
-jKeywordConst = JKeywordConst <$> (choice $ try <$> string <$> keywordConstStrs)
-
-jExpVar :: JackParser JExpression
-jExpVar = JExpVar <$> jVarId
-
-jVarId :: JackParser JVarId
-jVarId = do
- id <- jIdentifier
- maybeArray <- optionMaybe $ try (char '[' >> jExpression <* char ']')
- return $ JVarId id maybeArray
-
-jExpCall :: JackParser JExpression
-jExpCall = JExpCall <$> jSubroutineCall
-
-jExpUna :: JackParser JExpression
-jExpUna = do
- op <- oneOf unaryOpChars
- many jSpace
- x <- jTerm
- return $ JExpUna op x
-
-jExpInBraces :: JackParser JExpression
-jExpInBraces = between (char '(') (char ')') jExpression -- expressions like a + () is not allowed
-
-jExpBin :: JackParser JExpression
-jExpBin = try $ do
- x <- jTerm
- xs <- many1 jOpAndTerm
- return $ JExpBin x xs
-
-jOpAndTerm :: JackParser (JBOp, JExpression)
-jOpAndTerm = do
- op <- many jSpace >> jBOp
- x <- many jSpace >> jTerm
- return (op, x)
-
-jSubroutineDec :: JackParser JSubroutineDec
-jSubroutineDec = do
- header <- jSubroutineHeader
- many jSpace
- body <- jSubroutineBody
- return $ JSubroutineDec header body
-
-jSubroutineBody :: JackParser JSubroutineBody
-jSubroutineBody = do
- char '{'
- varDecs <- many $ try (many jSpace >> jVarDecs)
- stmts <- many $ try (many jSpace >> jStatement)
- many jSpace >> char '}'
- return $ JSubroutineBody (mconcat varDecs) stmts
-
-jStatement :: JackParser JStatement
-jStatement = choice [jLetStatement, jIfStatement, jWhileStatement, jDoStatement, jReturnStatement]
-
-jLetStatement :: JackParser JStatement
-jLetStatement = do
- string "let" >> many1 jSpace
- leftVarId <- jVarId
- many jSpace >> char '=' >> many jSpace
- exp <- jExpression
- many jSpace >> char ';'
- return $ JLetStatment leftVarId exp
-
-jIfStatement = do
- string "if" >> many jSpace >> char '(' >> many jSpace
- exp <- jExpression
- many jSpace >> char ')' >> many jSpace >> char '{' >> many jSpace
- stmts <- many (try $ many jSpace >> jStatement)
- many jSpace >> char '}'
- stmts' <- optionMaybe $ try jElseBlock
- return $ JIfStatement exp stmts stmts'
-
-jElseBlock :: JackParser [JStatement]
-jElseBlock = do
- many jSpace >> string "else" >> many jSpace >> char '{' >> many jSpace
- stmts <- many (try $ many jSpace >> jStatement)
- many jSpace >> char '}'
- return stmts
-
-jWhileStatement :: JackParser JStatement
-jWhileStatement = do
- string "while" >> many jSpace >> char '(' >> many jSpace
- exp <- jExpression
- many jSpace >> char ')' >> many jSpace >> char '{'
- stmts <- many (try $ many jSpace >> jStatement)
- many jSpace >> char '}'
- return $ JWhileStatment exp stmts
-
-jDoStatement :: JackParser JStatement
-jDoStatement = do
- jCall <- string "do" >> many jSpace >> jSubroutineCall
- many jSpace >> char ';'
- return $ JDoStatement jCall
-
-jReturnStatement :: JackParser JStatement
-jReturnStatement = do
- string "return" >> many jSpace
- res <- optionMaybe $ try jExpression
- many jSpace >> char ';'
- return $ JReturnStatement res
-
-jSubroutineCall :: JackParser JSubroutineCall
-jSubroutineCall = try $ do
- callee <- jIdentifier
- method <- optionMaybe $ try (char '.' >> jIdentifier)
- args <- emptyArgs <|> someArgs
- return $ JSubroutineCall callee method args
-
-emptyArgs :: JackParser [JExpression]
-emptyArgs = return [] <* (try $ char '(' >> many jSpace >> char ')')
-
-someArgs :: JackParser [JExpression]
-someArgs = do
- char '(' >> many jSpace
- exps <- sepBy jExpression (many jSpace >> char ',' >> many jSpace)
- many jSpace >> char ')'
- return exps
-
-{--
-replCrWithNl :: [Char] -> [Char]
-replCrWithNl = fmap cr2nl
- where cr2nl '\r' = '\n'
- cr2nl c = c
- --}
-
--- IO
-
-main = do
- dir <- head <$> getArgs
- filesWODir <- filter isJackFile <$> listDirectory dir
- let jackFiles = (dir++) <$> filesWODir
- codes <- sequence $ readFile <$> jackFiles
- zipWithM writeFile (chExt <$> jackFiles) (show . jack <$> codes)
- where isJackFile xs = drop (length xs - 5) xs == ".jack"
- chExt xs = take (length xs - 4) xs ++ "ast"
- --}
diff --git a/projects/10/JackParser.o b/projects/10/JackParser.o
deleted file mode 100644
index d33b200..0000000
--- a/projects/10/JackParser.o
+++ /dev/null
Binary files differ
diff --git a/projects/10/Square/Main.ast b/projects/10/Square/Main.ast
deleted file mode 100644
index d314f03..0000000
--- a/projects/10/Square/Main.ast
+++ /dev/null
@@ -1 +0,0 @@
-Right (JClass "Main" [JClassVarDec "static" ("boolean","test")] [JSubroutineDec (JSubroutineHeader "function" ("void","main") []) (JSubroutineBody [("SquareGame","game")] [JLetStatment (JVarId "game" Nothing) (JExpCall (JSubroutineCall "SquareGame" (Just "new") [])),JDoStatement (JSubroutineCall "game" (Just "run") []),JDoStatement (JSubroutineCall "game" (Just "dispose") []),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "function" ("void","test") []) (JSubroutineBody [("int","i"),("int","j"),("String","s"),("Array","a")] [JIfStatement (JKeywordConst "false") [JLetStatment (JVarId "s" Nothing) (JStrConst "string constant"),JLetStatment (JVarId "s" Nothing) (JKeywordConst "null"),JLetStatment (JVarId "a" (Just (JIntConst 1))) (JExpVar (JVarId "a" (Just (JIntConst 2))))] (Just [JLetStatment (JVarId "i" Nothing) (JExpBin (JExpVar (JVarId "i" Nothing)) [('*',JExpUna '-' (JExpVar (JVarId "j" Nothing)))]),JLetStatment (JVarId "j" Nothing) (JExpBin (JExpVar (JVarId "j" Nothing)) [('/',JExpUna '-' (JIntConst 2))]),JLetStatment (JVarId "i" Nothing) (JExpBin (JExpVar (JVarId "i" Nothing)) [('|',JExpVar (JVarId "j" Nothing))])]),JReturnStatement Nothing])]) \ No newline at end of file
diff --git a/projects/10/Square/Main.jack b/projects/10/Square/Main.jack
deleted file mode 100644
index 0b9e4cb..0000000
--- a/projects/10/Square/Main.jack
+++ /dev/null
@@ -1,36 +0,0 @@
-// This file is part of www.nand2tetris.org
-// and the book "The Elements of Computing Systems"
-// by Nisan and Schocken, MIT Press.
-// File name: projects/10/Square/Main.jack
-
-// (derived from projects/09/Square/Main.jack, with testing additions)
-
-/** Initializes a new Square Dance game and starts running it. */
-class Main {
- static boolean test; // Added for testing -- there is no static keyword
- // in the Square files.
- function void main() {
- var SquareGame game;
- let game = SquareGame.new();
- do game.run();
- do game.dispose();
- return;
- }
-
- function void test() { // Added to test Jack syntax that is not use in
- var int i, j; // the Square files.
- var String s;
- var Array a;
- if (false) {
- let s = "string constant";
- let s = null;
- let a[1] = a[2];
- }
- else { // There is no else keyword in the Square files.
- let i = i * (-j);
- let j = j / (-2); // note: unary negate constant 2
- let i = i | j;
- }
- return;
- }
-}
diff --git a/projects/10/Square/Main.xml b/projects/10/Square/Main.xml
deleted file mode 100644
index f6863c6..0000000
--- a/projects/10/Square/Main.xml
+++ /dev/null
@@ -1,244 +0,0 @@
-<class>
- <keyword> class </keyword>
- <identifier> Main </identifier>
- <symbol> { </symbol>
- <classVarDec>
- <keyword> static </keyword>
- <keyword> boolean </keyword>
- <identifier> test </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <subroutineDec>
- <keyword> function </keyword>
- <keyword> void </keyword>
- <identifier> main </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <varDec>
- <keyword> var </keyword>
- <identifier> SquareGame </identifier>
- <identifier> game </identifier>
- <symbol> ; </symbol>
- </varDec>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> game </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> SquareGame </identifier>
- <symbol> . </symbol>
- <identifier> new </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> game </identifier>
- <symbol> . </symbol>
- <identifier> run </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> game </identifier>
- <symbol> . </symbol>
- <identifier> dispose </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> function </keyword>
- <keyword> void </keyword>
- <identifier> test </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <varDec>
- <keyword> var </keyword>
- <keyword> int </keyword>
- <identifier> i </identifier>
- <symbol> , </symbol>
- <identifier> j </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <identifier> String </identifier>
- <identifier> s </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <identifier> Array </identifier>
- <identifier> a </identifier>
- <symbol> ; </symbol>
- </varDec>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <keyword> false </keyword>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> s </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <stringConstant> string constant </stringConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> s </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <keyword> null </keyword>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> a </identifier>
- <symbol> [ </symbol>
- <expression>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ] </symbol>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> a </identifier>
- <symbol> [ </symbol>
- <expression>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ] </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- <keyword> else </keyword>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> * </symbol>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> - </symbol>
- <term>
- <identifier> j </identifier>
- </term>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> j </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> j </identifier>
- </term>
- <symbol> / </symbol>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> - </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> | </symbol>
- <term>
- <identifier> j </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <symbol> } </symbol>
-</class>
diff --git a/projects/10/Square/MainT.xml b/projects/10/Square/MainT.xml
deleted file mode 100644
index 950c050..0000000
--- a/projects/10/Square/MainT.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<tokens>
-<keyword> class </keyword>
-<identifier> Main </identifier>
-<symbol> { </symbol>
-<keyword> static </keyword>
-<keyword> boolean </keyword>
-<identifier> test </identifier>
-<symbol> ; </symbol>
-<keyword> function </keyword>
-<keyword> void </keyword>
-<identifier> main </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> var </keyword>
-<identifier> SquareGame </identifier>
-<identifier> game </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> game </identifier>
-<symbol> = </symbol>
-<identifier> SquareGame </identifier>
-<symbol> . </symbol>
-<identifier> new </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> game </identifier>
-<symbol> . </symbol>
-<identifier> run </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> game </identifier>
-<symbol> . </symbol>
-<identifier> dispose </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> function </keyword>
-<keyword> void </keyword>
-<identifier> test </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> var </keyword>
-<keyword> int </keyword>
-<identifier> i </identifier>
-<symbol> , </symbol>
-<identifier> j </identifier>
-<symbol> ; </symbol>
-<keyword> var </keyword>
-<identifier> String </identifier>
-<identifier> s </identifier>
-<symbol> ; </symbol>
-<keyword> var </keyword>
-<identifier> Array </identifier>
-<identifier> a </identifier>
-<symbol> ; </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<keyword> false </keyword>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> s </identifier>
-<symbol> = </symbol>
-<stringConstant> string constant </stringConstant>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> s </identifier>
-<symbol> = </symbol>
-<keyword> null </keyword>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> a </identifier>
-<symbol> [ </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ] </symbol>
-<symbol> = </symbol>
-<identifier> a </identifier>
-<symbol> [ </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ] </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> else </keyword>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> i </identifier>
-<symbol> = </symbol>
-<identifier> i </identifier>
-<symbol> * </symbol>
-<symbol> ( </symbol>
-<symbol> - </symbol>
-<identifier> j </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> j </identifier>
-<symbol> = </symbol>
-<identifier> j </identifier>
-<symbol> / </symbol>
-<symbol> ( </symbol>
-<symbol> - </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> i </identifier>
-<symbol> = </symbol>
-<identifier> i </identifier>
-<symbol> | </symbol>
-<identifier> j </identifier>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-</tokens>
diff --git a/projects/10/Square/Square.ast b/projects/10/Square/Square.ast
deleted file mode 100644
index d360f5f..0000000
--- a/projects/10/Square/Square.ast
+++ /dev/null
@@ -1 +0,0 @@
-Right (JClass "Square" [JClassVarDec "field" ("int","x"),JClassVarDec "field" ("int","y"),JClassVarDec "field" ("int","size")] [JSubroutineDec (JSubroutineHeader "constructor" ("Square","new") [("int","Ax"),("int","Ay"),("int","Asize")]) (JSubroutineBody [] [JLetStatment (JVarId "x" Nothing) (JExpVar (JVarId "Ax" Nothing)),JLetStatment (JVarId "y" Nothing) (JExpVar (JVarId "Ay" Nothing)),JLetStatment (JVarId "size" Nothing) (JExpVar (JVarId "Asize" Nothing)),JDoStatement (JSubroutineCall "draw" Nothing []),JReturnStatement (Just (JKeywordConst "this"))]),JSubroutineDec (JSubroutineHeader "method" ("void","dispose") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "Memory" (Just "deAlloc") [JKeywordConst "this"]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","draw") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "true"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","erase") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "false"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","incSize") []) (JSubroutineBody [] [JIfStatement (JExpBin (JExpBin (JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]) [('<',JIntConst 254)]) [('&',JExpBin (JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]) [('<',JIntConst 510)])]) [JDoStatement (JSubroutineCall "erase" Nothing []),JLetStatment (JVarId "size" Nothing) (JExpBin (JExpVar (JVarId "size" Nothing)) [('+',JIntConst 2)]),JDoStatement (JSubroutineCall "draw" Nothing [])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","decSize") []) (JSubroutineBody [] [JIfStatement (JExpBin (JExpVar (JVarId "size" Nothing)) [('>',JIntConst 2)]) [JDoStatement (JSubroutineCall "erase" Nothing []),JLetStatment (JVarId "size" Nothing) (JExpBin (JExpVar (JVarId "size" Nothing)) [('-',JIntConst 2)]),JDoStatement (JSubroutineCall "draw" Nothing [])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveUp") []) (JSubroutineBody [] [JIfStatement (JExpBin (JExpVar (JVarId "y" Nothing)) [('>',JIntConst 1)]) [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "false"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpBin (JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]) [('-',JIntConst 1)],JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]]),JLetStatment (JVarId "y" Nothing) (JExpBin (JExpVar (JVarId "y" Nothing)) [('-',JIntConst 2)]),JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "true"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JIntConst 1)]])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveDown") []) (JSubroutineBody [] [JIfStatement (JExpBin (JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]) [('<',JIntConst 254)]) [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "false"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JIntConst 1)]]),JLetStatment (JVarId "y" Nothing) (JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JIntConst 2)]),JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "true"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpBin (JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]) [('-',JIntConst 1)],JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveLeft") []) (JSubroutineBody [] [JIfStatement (JExpBin (JExpVar (JVarId "x" Nothing)) [('>',JIntConst 1)]) [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "false"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpBin (JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]) [('-',JIntConst 1)],JExpVar (JVarId "y" Nothing),JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]]),JLetStatment (JVarId "x" Nothing) (JExpBin (JExpVar (JVarId "x" Nothing)) [('-',JIntConst 2)]),JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "true"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JIntConst 1)],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]])] Nothing,JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveRight") []) (JSubroutineBody [] [JIfStatement (JExpBin (JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]) [('<',JIntConst 510)]) [JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "false"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpVar (JVarId "x" Nothing),JExpVar (JVarId "y" Nothing),JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JIntConst 1)],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]]),JLetStatment (JVarId "x" Nothing) (JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JIntConst 2)]),JDoStatement (JSubroutineCall "Screen" (Just "setColor") [JKeywordConst "true"]),JDoStatement (JSubroutineCall "Screen" (Just "drawRectangle") [JExpBin (JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]) [('-',JIntConst 1)],JExpVar (JVarId "y" Nothing),JExpBin (JExpVar (JVarId "x" Nothing)) [('+',JExpVar (JVarId "size" Nothing))],JExpBin (JExpVar (JVarId "y" Nothing)) [('+',JExpVar (JVarId "size" Nothing))]])] Nothing,JReturnStatement Nothing])]) \ No newline at end of file
diff --git a/projects/10/Square/Square.jack b/projects/10/Square/Square.jack
deleted file mode 100644
index 3faf24f..0000000
--- a/projects/10/Square/Square.jack
+++ /dev/null
@@ -1,110 +0,0 @@
-// This file is part of www.nand2tetris.org
-// and the book "The Elements of Computing Systems"
-// by Nisan and Schocken, MIT Press.
-// File name: projects/10/Square/Square.jack
-
-// (same as projects/09/Square/Square.jack)
-
-/** Implements a graphical square. */
-class Square {
-
- field int x, y; // screen location of the square's top-left corner
- field int size; // length of this square, in pixels
-
- /** Constructs a new square with a given location and size. */
- constructor Square new(int Ax, int Ay, int Asize) {
- let x = Ax;
- let y = Ay;
- let size = Asize;
- do draw();
- return this;
- }
-
- /** Disposes this square. */
- method void dispose() {
- do Memory.deAlloc(this);
- return;
- }
-
- /** Draws the square on the screen. */
- method void draw() {
- do Screen.setColor(true);
- do Screen.drawRectangle(x, y, x + size, y + size);
- return;
- }
-
- /** Erases the square from the screen. */
- method void erase() {
- do Screen.setColor(false);
- do Screen.drawRectangle(x, y, x + size, y + size);
- return;
- }
-
- /** Increments the square size by 2 pixels. */
- method void incSize() {
- if (((y + size) < 254) & ((x + size) < 510)) {
- do erase();
- let size = size + 2;
- do draw();
- }
- return;
- }
-
- /** Decrements the square size by 2 pixels. */
- method void decSize() {
- if (size > 2) {
- do erase();
- let size = size - 2;
- do draw();
- }
- return;
- }
-
- /** Moves the square up by 2 pixels. */
- method void moveUp() {
- if (y > 1) {
- do Screen.setColor(false);
- do Screen.drawRectangle(x, (y + size) - 1, x + size, y + size);
- let y = y - 2;
- do Screen.setColor(true);
- do Screen.drawRectangle(x, y, x + size, y + 1);
- }
- return;
- }
-
- /** Moves the square down by 2 pixels. */
- method void moveDown() {
- if ((y + size) < 254) {
- do Screen.setColor(false);
- do Screen.drawRectangle(x, y, x + size, y + 1);
- let y = y + 2;
- do Screen.setColor(true);
- do Screen.drawRectangle(x, (y + size) - 1, x + size, y + size);
- }
- return;
- }
-
- /** Moves the square left by 2 pixels. */
- method void moveLeft() {
- if (x > 1) {
- do Screen.setColor(false);
- do Screen.drawRectangle((x + size) - 1, y, x + size, y + size);
- let x = x - 2;
- do Screen.setColor(true);
- do Screen.drawRectangle(x, y, x + 1, y + size);
- }
- return;
- }
-
- /** Moves the square right by 2 pixels. */
- method void moveRight() {
- if ((x + size) < 510) {
- do Screen.setColor(false);
- do Screen.drawRectangle(x, y, x + 1, y + size);
- let x = x + 2;
- do Screen.setColor(true);
- do Screen.drawRectangle((x + size) - 1, y, x + size, y + size);
- }
- return;
- }
-}
diff --git a/projects/10/Square/Square.xml b/projects/10/Square/Square.xml
deleted file mode 100644
index ff5f235..0000000
--- a/projects/10/Square/Square.xml
+++ /dev/null
@@ -1,1211 +0,0 @@
-<class>
- <keyword> class </keyword>
- <identifier> Square </identifier>
- <symbol> { </symbol>
- <classVarDec>
- <keyword> field </keyword>
- <keyword> int </keyword>
- <identifier> x </identifier>
- <symbol> , </symbol>
- <identifier> y </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <classVarDec>
- <keyword> field </keyword>
- <keyword> int </keyword>
- <identifier> size </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <subroutineDec>
- <keyword> constructor </keyword>
- <identifier> Square </identifier>
- <identifier> new </identifier>
- <symbol> ( </symbol>
- <parameterList>
- <keyword> int </keyword>
- <identifier> Ax </identifier>
- <symbol> , </symbol>
- <keyword> int </keyword>
- <identifier> Ay </identifier>
- <symbol> , </symbol>
- <keyword> int </keyword>
- <identifier> Asize </identifier>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> x </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Ax </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> y </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Ay </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> size </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Asize </identifier>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> draw </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <expression>
- <term>
- <keyword> this </keyword>
- </term>
- </expression>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> dispose </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Memory </identifier>
- <symbol> . </symbol>
- <identifier> deAlloc </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> this </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> draw </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> true </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> erase </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> false </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> incSize </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> &lt; </symbol>
- <term>
- <integerConstant> 254 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> &amp; </symbol>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> &lt; </symbol>
- <term>
- <integerConstant> 510 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> erase </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> size </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> size </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> draw </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> decSize </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> size </identifier>
- </term>
- <symbol> &gt; </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> erase </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> size </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> size </identifier>
- </term>
- <symbol> - </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> draw </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveUp </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> &gt; </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> false </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> - </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> y </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> - </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> true </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveDown </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> &lt; </symbol>
- <term>
- <integerConstant> 254 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> false </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> y </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> true </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> - </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveLeft </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> &gt; </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> false </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> - </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> x </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> - </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> true </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveRight </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> &lt; </symbol>
- <term>
- <integerConstant> 510 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> false </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> x </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> setColor </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> true </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Screen </identifier>
- <symbol> . </symbol>
- <identifier> drawRectangle </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- <symbol> - </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> x </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <identifier> y </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> size </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <symbol> } </symbol>
-</class>
diff --git a/projects/10/Square/SquareGame.ast b/projects/10/Square/SquareGame.ast
deleted file mode 100644
index 55a9ff0..0000000
--- a/projects/10/Square/SquareGame.ast
+++ /dev/null
@@ -1 +0,0 @@
-Right (JClass "SquareGame" [JClassVarDec "field" ("Square","square"),JClassVarDec "field" ("int","direction")] [JSubroutineDec (JSubroutineHeader "constructor" ("SquareGame","new") []) (JSubroutineBody [] [JLetStatment (JVarId "square" Nothing) (JExpCall (JSubroutineCall "Square" (Just "new") [JIntConst 0,JIntConst 0,JIntConst 30])),JLetStatment (JVarId "direction" Nothing) (JIntConst 0),JReturnStatement (Just (JKeywordConst "this"))]),JSubroutineDec (JSubroutineHeader "method" ("void","dispose") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "square" (Just "dispose") []),JDoStatement (JSubroutineCall "Memory" (Just "deAlloc") [JKeywordConst "this"]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveSquare") []) (JSubroutineBody [] [JIfStatement (JExpBin (JExpVar (JVarId "direction" Nothing)) [('=',JIntConst 1)]) [JDoStatement (JSubroutineCall "square" (Just "moveUp") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "direction" Nothing)) [('=',JIntConst 2)]) [JDoStatement (JSubroutineCall "square" (Just "moveDown") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "direction" Nothing)) [('=',JIntConst 3)]) [JDoStatement (JSubroutineCall "square" (Just "moveLeft") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "direction" Nothing)) [('=',JIntConst 4)]) [JDoStatement (JSubroutineCall "square" (Just "moveRight") [])] Nothing,JDoStatement (JSubroutineCall "Sys" (Just "wait") [JIntConst 5]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","run") []) (JSubroutineBody [("char","key"),("boolean","exit")] [JLetStatment (JVarId "exit" Nothing) (JKeywordConst "false"),JWhileStatment (JExpUna '~' (JExpVar (JVarId "exit" Nothing))) [JWhileStatment (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 0)]) [JLetStatment (JVarId "key" Nothing) (JExpCall (JSubroutineCall "Keyboard" (Just "keyPressed") [])),JDoStatement (JSubroutineCall "moveSquare" Nothing [])],JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 81)]) [JLetStatment (JVarId "exit" Nothing) (JKeywordConst "true")] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 90)]) [JDoStatement (JSubroutineCall "square" (Just "decSize") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 88)]) [JDoStatement (JSubroutineCall "square" (Just "incSize") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 131)]) [JLetStatment (JVarId "direction" Nothing) (JIntConst 1)] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 133)]) [JLetStatment (JVarId "direction" Nothing) (JIntConst 2)] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 130)]) [JLetStatment (JVarId "direction" Nothing) (JIntConst 3)] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 132)]) [JLetStatment (JVarId "direction" Nothing) (JIntConst 4)] Nothing,JWhileStatment (JExpUna '~' (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 0)])) [JLetStatment (JVarId "key" Nothing) (JExpCall (JSubroutineCall "Keyboard" (Just "keyPressed") [])),JDoStatement (JSubroutineCall "moveSquare" Nothing [])]],JReturnStatement Nothing])]) \ No newline at end of file
diff --git a/projects/10/Square/SquareGame.jack b/projects/10/Square/SquareGame.jack
deleted file mode 100644
index 4f71b16..0000000
--- a/projects/10/Square/SquareGame.jack
+++ /dev/null
@@ -1,81 +0,0 @@
-// This file is part of www.nand2tetris.org
-// and the book "The Elements of Computing Systems"
-// by Nisan and Schocken, MIT Press.
-// File name: projects/10/Square/SquareGame.jack
-
-// (same as projects/09/Square/SquareGame.jack)
-
-/**
- * Implements the Square Dance game.
- * This simple game allows the user to move a black square around
- * the screen, and change the square's size during the movement.
- * When the game starts, a square of 30 by 30 pixels is shown at the
- * top-left corner of the screen. The user controls the square as follows.
- * The 4 arrow keys are used to move the square up, down, left, and right.
- * The 'z' and 'x' keys are used, respectively, to decrement and increment
- * the square's size. The 'q' key is used to quit the game.
- */
-
-class SquareGame {
- field Square square; // the square of this game
- field int direction; // the square's current direction:
- // 0=none, 1=up, 2=down, 3=left, 4=right
-
- /** Constructs a new Square Game. */
- constructor SquareGame new() {
- // Creates a 30 by 30 pixels square and positions it at the top-left
- // of the screen.
- let square = Square.new(0, 0, 30);
- let direction = 0; // initial state is no movement
- return this;
- }
-
- /** Disposes this game. */
- method void dispose() {
- do square.dispose();
- do Memory.deAlloc(this);
- return;
- }
-
- /** Moves the square in the current direction. */
- method void moveSquare() {
- if (direction = 1) { do square.moveUp(); }
- if (direction = 2) { do square.moveDown(); }
- if (direction = 3) { do square.moveLeft(); }
- if (direction = 4) { do square.moveRight(); }
- do Sys.wait(5); // delays the next movement
- return;
- }
-
- /** Runs the game: handles the user's inputs and moves the square accordingly */
- method void run() {
- var char key; // the key currently pressed by the user
- var boolean exit;
- let exit = false;
-
- while (~exit) {
- // waits for a key to be pressed
- while (key = 0) {
- let key = Keyboard.keyPressed();
- do moveSquare();
- }
- if (key = 81) { let exit = true; } // q key
- if (key = 90) { do square.decSize(); } // z key
- if (key = 88) { do square.incSize(); } // x key
- if (key = 131) { let direction = 1; } // up arrow
- if (key = 133) { let direction = 2; } // down arrow
- if (key = 130) { let direction = 3; } // left arrow
- if (key = 132) { let direction = 4; } // right arrow
-
- // waits for the key to be released
- while (~(key = 0)) {
- let key = Keyboard.keyPressed();
- do moveSquare();
- }
- } // while
- return;
- }
-}
-
-
-
diff --git a/projects/10/Square/SquareGame.xml b/projects/10/Square/SquareGame.xml
deleted file mode 100644
index ed3ab6e..0000000
--- a/projects/10/Square/SquareGame.xml
+++ /dev/null
@@ -1,643 +0,0 @@
-<class>
- <keyword> class </keyword>
- <identifier> SquareGame </identifier>
- <symbol> { </symbol>
- <classVarDec>
- <keyword> field </keyword>
- <identifier> Square </identifier>
- <identifier> square </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <classVarDec>
- <keyword> field </keyword>
- <keyword> int </keyword>
- <identifier> direction </identifier>
- <symbol> ; </symbol>
- </classVarDec>
- <subroutineDec>
- <keyword> constructor </keyword>
- <identifier> SquareGame </identifier>
- <identifier> new </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> square </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Square </identifier>
- <symbol> . </symbol>
- <identifier> new </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> , </symbol>
- <expression>
- <term>
- <integerConstant> 30 </integerConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <returnStatement>
- <keyword> return </keyword>
- <expression>
- <term>
- <keyword> this </keyword>
- </term>
- </expression>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> dispose </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> dispose </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Memory </identifier>
- <symbol> . </symbol>
- <identifier> deAlloc </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <keyword> this </keyword>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> moveSquare </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <statements>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> moveUp </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> moveDown </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 3 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> moveLeft </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> direction </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 4 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> moveRight </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Sys </identifier>
- <symbol> . </symbol>
- <identifier> wait </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <integerConstant> 5 </integerConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <subroutineDec>
- <keyword> method </keyword>
- <keyword> void </keyword>
- <identifier> run </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <varDec>
- <keyword> var </keyword>
- <keyword> char </keyword>
- <identifier> key </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <keyword> boolean </keyword>
- <identifier> exit </identifier>
- <symbol> ; </symbol>
- </varDec>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> exit </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <keyword> false </keyword>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> ~ </symbol>
- <term>
- <identifier> exit </identifier>
- </term>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> key </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Keyboard </identifier>
- <symbol> . </symbol>
- <identifier> keyPressed </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> moveSquare </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 81 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> exit </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <keyword> true </keyword>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 90 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> decSize </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 88 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <doStatement>
- <keyword> do </keyword>
- <identifier> square </identifier>
- <symbol> . </symbol>
- <identifier> incSize </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 131 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 133 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 2 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 130 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 3 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <ifStatement>
- <keyword> if </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 132 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> direction </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 4 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </ifStatement>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <symbol> ~ </symbol>
- <term>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> key </identifier>
- </term>
- <symbol> = </symbol>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ) </symbol>
- </term>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> key </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Keyboard </identifier>
- <symbol> . </symbol>
- <identifier> keyPressed </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> moveSquare </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <symbol> } </symbol>
-</class>
diff --git a/projects/10/Square/SquareGameT.xml b/projects/10/Square/SquareGameT.xml
deleted file mode 100644
index 3136af2..0000000
--- a/projects/10/Square/SquareGameT.xml
+++ /dev/null
@@ -1,315 +0,0 @@
-<tokens>
-<keyword> class </keyword>
-<identifier> SquareGame </identifier>
-<symbol> { </symbol>
-<keyword> field </keyword>
-<identifier> Square </identifier>
-<identifier> square </identifier>
-<symbol> ; </symbol>
-<keyword> field </keyword>
-<keyword> int </keyword>
-<identifier> direction </identifier>
-<symbol> ; </symbol>
-<keyword> constructor </keyword>
-<identifier> SquareGame </identifier>
-<identifier> new </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> square </identifier>
-<symbol> = </symbol>
-<identifier> Square </identifier>
-<symbol> . </symbol>
-<identifier> new </identifier>
-<symbol> ( </symbol>
-<integerConstant> 0 </integerConstant>
-<symbol> , </symbol>
-<integerConstant> 0 </integerConstant>
-<symbol> , </symbol>
-<integerConstant> 30 </integerConstant>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 0 </integerConstant>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<keyword> this </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> dispose </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> dispose </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Memory </identifier>
-<symbol> . </symbol>
-<identifier> deAlloc </identifier>
-<symbol> ( </symbol>
-<keyword> this </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveSquare </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> moveUp </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> moveDown </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 3 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> moveLeft </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 4 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> moveRight </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> do </keyword>
-<identifier> Sys </identifier>
-<symbol> . </symbol>
-<identifier> wait </identifier>
-<symbol> ( </symbol>
-<integerConstant> 5 </integerConstant>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> run </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> var </keyword>
-<keyword> char </keyword>
-<identifier> key </identifier>
-<symbol> ; </symbol>
-<keyword> var </keyword>
-<keyword> boolean </keyword>
-<identifier> exit </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> exit </identifier>
-<symbol> = </symbol>
-<keyword> false </keyword>
-<symbol> ; </symbol>
-<keyword> while </keyword>
-<symbol> ( </symbol>
-<symbol> ~ </symbol>
-<identifier> exit </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> while </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 0 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<identifier> Keyboard </identifier>
-<symbol> . </symbol>
-<identifier> keyPressed </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> moveSquare </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 81 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> exit </identifier>
-<symbol> = </symbol>
-<keyword> true </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 90 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> decSize </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 88 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> square </identifier>
-<symbol> . </symbol>
-<identifier> incSize </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 131 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 133 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 130 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 3 </integerConstant>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 132 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> direction </identifier>
-<symbol> = </symbol>
-<integerConstant> 4 </integerConstant>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> while </keyword>
-<symbol> ( </symbol>
-<symbol> ~ </symbol>
-<symbol> ( </symbol>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<integerConstant> 0 </integerConstant>
-<symbol> ) </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> key </identifier>
-<symbol> = </symbol>
-<identifier> Keyboard </identifier>
-<symbol> . </symbol>
-<identifier> keyPressed </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> moveSquare </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-</tokens>
diff --git a/projects/10/Square/SquareT.xml b/projects/10/Square/SquareT.xml
deleted file mode 100644
index 69a8ca0..0000000
--- a/projects/10/Square/SquareT.xml
+++ /dev/null
@@ -1,561 +0,0 @@
-<tokens>
-<keyword> class </keyword>
-<identifier> Square </identifier>
-<symbol> { </symbol>
-<keyword> field </keyword>
-<keyword> int </keyword>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> ; </symbol>
-<keyword> field </keyword>
-<keyword> int </keyword>
-<identifier> size </identifier>
-<symbol> ; </symbol>
-<keyword> constructor </keyword>
-<identifier> Square </identifier>
-<identifier> new </identifier>
-<symbol> ( </symbol>
-<keyword> int </keyword>
-<identifier> Ax </identifier>
-<symbol> , </symbol>
-<keyword> int </keyword>
-<identifier> Ay </identifier>
-<symbol> , </symbol>
-<keyword> int </keyword>
-<identifier> Asize </identifier>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> let </keyword>
-<identifier> x </identifier>
-<symbol> = </symbol>
-<identifier> Ax </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> y </identifier>
-<symbol> = </symbol>
-<identifier> Ay </identifier>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> size </identifier>
-<symbol> = </symbol>
-<identifier> Asize </identifier>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> draw </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<keyword> this </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> dispose </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Memory </identifier>
-<symbol> . </symbol>
-<identifier> deAlloc </identifier>
-<symbol> ( </symbol>
-<keyword> this </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> draw </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> true </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> erase </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> false </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> incSize </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<symbol> ( </symbol>
-<symbol> ( </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> &lt; </symbol>
-<integerConstant> 254 </integerConstant>
-<symbol> ) </symbol>
-<symbol> &amp; </symbol>
-<symbol> ( </symbol>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> &lt; </symbol>
-<integerConstant> 510 </integerConstant>
-<symbol> ) </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> erase </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> size </identifier>
-<symbol> = </symbol>
-<identifier> size </identifier>
-<symbol> + </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> draw </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> decSize </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> size </identifier>
-<symbol> &gt; </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> erase </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> size </identifier>
-<symbol> = </symbol>
-<identifier> size </identifier>
-<symbol> - </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> draw </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveUp </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> y </identifier>
-<symbol> &gt; </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> false </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<symbol> ( </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> - </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> y </identifier>
-<symbol> = </symbol>
-<identifier> y </identifier>
-<symbol> - </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> true </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveDown </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<symbol> ( </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> &lt; </symbol>
-<integerConstant> 254 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> false </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> y </identifier>
-<symbol> = </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> true </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<symbol> ( </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> - </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveLeft </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> &gt; </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> false </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> - </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> x </identifier>
-<symbol> = </symbol>
-<identifier> x </identifier>
-<symbol> - </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> true </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> method </keyword>
-<keyword> void </keyword>
-<identifier> moveRight </identifier>
-<symbol> ( </symbol>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> if </keyword>
-<symbol> ( </symbol>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> &lt; </symbol>
-<integerConstant> 510 </integerConstant>
-<symbol> ) </symbol>
-<symbol> { </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> false </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> let </keyword>
-<identifier> x </identifier>
-<symbol> = </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<integerConstant> 2 </integerConstant>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> setColor </identifier>
-<symbol> ( </symbol>
-<keyword> true </keyword>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<keyword> do </keyword>
-<identifier> Screen </identifier>
-<symbol> . </symbol>
-<identifier> drawRectangle </identifier>
-<symbol> ( </symbol>
-<symbol> ( </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> - </symbol>
-<integerConstant> 1 </integerConstant>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> , </symbol>
-<identifier> x </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> , </symbol>
-<identifier> y </identifier>
-<symbol> + </symbol>
-<identifier> size </identifier>
-<symbol> ) </symbol>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<keyword> return </keyword>
-<symbol> ; </symbol>
-<symbol> } </symbol>
-<symbol> } </symbol>
-</tokens>
diff --git a/projects/10/jackspec.wiki b/projects/10/jackspec.wiki
deleted file mode 100644
index e746941..0000000
--- a/projects/10/jackspec.wiki
+++ /dev/null
@@ -1,3 +0,0 @@
-Class = Name ClassVarDec* SubroutineDec*
-ClassVarDec = ClassVarScope Type Identifier*
-Type = JInt
diff --git a/projects/10/spec1 b/projects/10/spec1
deleted file mode 100644
index e69de29..0000000
--- a/projects/10/spec1
+++ /dev/null
diff --git a/projects/10/spec1.png b/projects/10/spec1.png
deleted file mode 100644
index d1a128e..0000000
--- a/projects/10/spec1.png
+++ /dev/null
Binary files differ
diff --git a/projects/10/spec2.png b/projects/10/spec2.png
deleted file mode 100644
index 8cd374b..0000000
--- a/projects/10/spec2.png
+++ /dev/null
Binary files differ
diff --git a/projects/10/test/Main.ast b/projects/10/test/Main.ast
deleted file mode 100644
index f8194cb..0000000
--- a/projects/10/test/Main.ast
+++ /dev/null
@@ -1 +0,0 @@
-Right (JClass "Main" [] [JSubroutineDec (JSubroutineHeader "function" ("void","main") []) (JSubroutineBody [("Array","a"),("int","length"),("int","i"),("int","sum")] [JLetStatment (JVarId "length" Nothing) (JExpCall (JSubroutineCall "Keyboard" (Just "readInt") [JStrConst "HOW MANY NUMBERS? "])),JLetStatment (JVarId "a" Nothing) (JExpCall (JSubroutineCall "Array" (Just "new") [JExpVar (JVarId "length" Nothing)])),JLetStatment (JVarId "i" Nothing) (JIntConst 0),JWhileStatment (JExpBin (JExpVar (JVarId "i" Nothing)) [('<',JExpVar (JVarId "length" Nothing))]) [JLetStatment (JVarId "a" (Just (JExpVar (JVarId "i" Nothing)))) (JExpCall (JSubroutineCall "Keyboard" (Just "readInt") [JStrConst "ENTER THE NEXT NUMBER: "])),JLetStatment (JVarId "i" Nothing) (JExpBin (JExpVar (JVarId "i" Nothing)) [('+',JIntConst 1)])],JLetStatment (JVarId "i" Nothing) (JIntConst 0),JLetStatment (JVarId "sum" Nothing) (JIntConst 0),JWhileStatment (JExpBin (JExpVar (JVarId "i" Nothing)) [('<',JExpVar (JVarId "length" Nothing))]) [JLetStatment (JVarId "sum" Nothing) (JExpBin (JExpVar (JVarId "sum" Nothing)) [('+',JExpVar (JVarId "a" (Just (JExpVar (JVarId "i" Nothing)))))]),JLetStatment (JVarId "i" Nothing) (JExpBin (JExpVar (JVarId "i" Nothing)) [('+',JIntConst 1)])],JDoStatement (JSubroutineCall "Output" (Just "printString") [JStrConst "THE AVERAGE IS: "]),JDoStatement (JSubroutineCall "Output" (Just "printInt") [JExpBin (JExpVar (JVarId "sum" Nothing)) [('/',JExpVar (JVarId "length" Nothing))]]),JDoStatement (JSubroutineCall "Output" (Just "println") []),JReturnStatement Nothing])]) \ No newline at end of file
diff --git a/projects/10/test/Main.jack b/projects/10/test/Main.jack
deleted file mode 100644
index cd80644..0000000
--- a/projects/10/test/Main.jack
+++ /dev/null
@@ -1,30 +0,0 @@
-class Main {
- function void main() {
- var Array a;
- var int length;
- var int i, sum;
-
- let length = Keyboard.readInt("HOW MANY NUMBERS? ");
- let a = Array.new(length);
- let i = 0;
-
- while (i < length) {
- let a[i] = Keyboard.readInt("ENTER THE NEXT NUMBER: ");
- let i = i + 1;
- }
-
- let i = 0;
- let sum = 0;
-
- while (i < length) {
- let sum = sum + a[i];
- let i = i + 1;
- }
-
- do Output.printString("THE AVERAGE IS: ");
- do Output.printInt(sum / length);
- do Output.println();
-
- return;
- }
-}