I'm having trouble getting this code to run. I have tried lots of things and there is something that I just don't see. If anyone out there can point out why everything past line 22 (except for comments) gets the dreaded red squigglies, I would appreciate it.
I'm very new to Java (my first program), so small words would be appreciated :)
Code:// This project should build a pyramid with a base of 14 blocks
// of block size 12 x 30 pixels. The pyramid should be centered in the screen.
package pleasework;
import acm.graphics.*;
import acm.program.*;
import java.lang.System;
public class BuildPyramid extends GraphicsProgram {
private final int BRICK_WIDTH = 30;
private final int BRICK_HEIGHT = 12;
private final int BRICKS_IN_BASE = 14;
BuildShit alpha = new BuildShit();
public void main() {
alpha.BuildShit(BRICKS_IN_BASE, BRICK_HEIGHT, BRICK_WIDTH);
}
}
private BuildShit() {
int screenW = getHeight();
for(int i=0;(i==BRICKS_IN_BASE - 1);i++) {
//starts a for loop that runs as many times as their are bricks in the base
for(int j = 0; j > ((BRICKS_IN_BASE - 1) - i);j++) {
//for loop to create a line counting down from bricks in base to one
int blockPosition = screenW/14 + ((j/2) * BRICK_WIDTH);
int rowHeight = (BRICKS_IN_BASE * BRICK_HEIGHT) * (BRICK_HEIGHT * i);
GRect rect = new GRect(blockPosition,rowHeight,BRICK_WIDTH,BRICK_HEIGHT);
add(rect);
System.out.println(rect);
blockPosition = blockPosition + BRICK_WIDTH;
}
}
}
