mirror of
https://github.com/usatiuk/nand2tetris.git
synced 2025-10-29 08:37:48 +01:00
init
This commit is contained in:
23
projects/Tables/Cell.jack
Normal file
23
projects/Tables/Cell.jack
Normal file
@@ -0,0 +1,23 @@
|
||||
class Cell {
|
||||
field int x, y, width, num, charWidth, charHeight;
|
||||
|
||||
constructor Cell new(int xl, int yl, int widthl, int numl) {
|
||||
let x = xl;
|
||||
let y = yl;
|
||||
let width = widthl;
|
||||
let num = numl;
|
||||
|
||||
let charWidth = 8;
|
||||
let charHeight = 11;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
method void draw() {
|
||||
do Output.moveCursor(y + 1, (x + 1) * width);
|
||||
do Output.printInt(num);
|
||||
|
||||
do Screen.drawLine(charWidth * x, y * charHeight, charWidth * (x + width), y * charHeight);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user