class Mario {
function void main() {
var int height;
var int row;
var int space;
var int hash;
let height = 0;
while (height < 1 | height > 8) {
do Output.printString("Height: ");
let height = Keyboard.readInt();
}
let row = 0;
while (row < height) {
let space = height - row - 1;
while (space > 0) {
do Output.printString(" ");
let space = space - 1;
}
let hash = 0;
while (hash < row + 1) {
do Output.printString("#");
let hash = hash + 1;
}
do Output.println();
let row = row + 1;
}
return;
}
}
It compiles just fine, but when running in VMEmulator it shows that I have out of segment space in Mario.main.2 In the vm file it is line - push local 0. I am a total noob,and can't seem to find a solution tot his. How do i fix this?
I have no clue how to fix this :(