mirror of
https://github.com/soconnor0919/nand2tetris-zed.git
synced 2025-12-12 23:24:45 -05:00
- Fixed HDL highlights query syntax error with #match? predicate - Replaced #match? with #any-of? for exact string matching - Fixed Hack Assembly outline query invalid field name - Improved HDL syntax highlighting with comprehensive patterns - Added HDL bracket matching for all syntax types - Fixed XML scope mismatch from text.xml to source.xml - Enhanced outline queries for better code navigation
25 lines
548 B
Plaintext
25 lines
548 B
Plaintext
class Math {
|
|
static Array twoToThe;
|
|
|
|
/** Initializes the library. */
|
|
function void init() {
|
|
var int i;
|
|
let twoToThe = Array.new(16);
|
|
let twoToThe[0] = 1;
|
|
let i = 1;
|
|
while (i < 16) {
|
|
let twoToThe[i] = twoToThe[i-1] + twoToThe[i-1];
|
|
let i = i + 1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
function int multiply(int x, int y) {
|
|
var int sum, shiftedX;
|
|
let sum = 0;
|
|
let shiftedX = x;
|
|
// Implementation details...
|
|
return sum;
|
|
}
|
|
}
|