Might be a misunderstanding on my part, but true doesn't behave the way I expected it to:
do Output.printString("TRUE");
}else{
do Output.printString("FALSE");
}
return ;
This prints FALSE.
I believe that this is because true = 1 whereas it should(?) be true = -1.
Additional Comments
This code:
do Output.moveCursor(10, 1);
do Output.printString("true:");
do Output.printInt(true);
do Output.moveCursor(11, 1);
do Output.printString(" 0<1:");
do Output.printInt(0<1);
do Output.moveCursor(12, 1);
do Output.printString(" -1:");
do Output.printInt(-1);
do Output.moveCursor(13, 1);
do Output.printString(" ~1:");
do Output.printInt(~1);
return;
Tool
Jack Compiler
Interface
Website (https://nand2tetris.github.io/web-ide)
Contact Details
No response
What happened?
Might be a misunderstanding on my part, but
true
doesn't behave the way I expected it to:This prints
FALSE
.I believe that this is because
true = 1
whereas it should(?) betrue = -1
.Additional Comments
This code:
Produces:
Which, even taking into account the missing
-
and~
(as mentioned here: https://github.com/nand2tetris/web-ide/issues/364#issue-2344239286) isn't what I'd expect.Do you want to try to fix this bug?
Code of Conduct