hey guys having this really simple problem but cant seem to figure out have to import this package called it but i have no idea where to put the actual folder on the mac, keeps on giving an error package does not exist, this is a really stupid question, but really have no idea what to do
here is the code (java) :
import it.*;
import java.awt.*;
public class pyramidColour
{
public static void main (String[] args)
{
int col1 = (int)(Math.random()*255+1);
int col2 = (int)(Math.random()*255+1);
int col3 = (int)(Math.random()*255+1);
Color newCol = new Color (col1, col2, col3);
Gogga bug= new Gogga();//creating the gogga
Gogga(1,8);
for (int i = 1; i <= 4; i ++)//loop for going up
{
bug.move();
bug.turnRight();
bug.move();
bug.turnLeft();
}
bug.setDirection(bug.DOWN);
for (int i = 1; i <= 3; i ++)//loop for going down
{
bug.move();
bug.turnLeft();
bug.move();
bug.turnRight();
}
bug.move();
bug.turnRight();
for (int i = 1; i <= 7; i ++)//loop for base of pyramid
{
bug.move();
}
}
}
The next part of the project is putting the loops into a method, any help would be greatly appreciated.
You have to include the classpath of the package in the java command :
.before;stand for current directory, where pyramidColour class is stored.Edit : on Mac the delimiter is not
;but:(thanks Jesper)If you are using an IDE (Eclipse, Netbeans) you can simply add the library in the project properties.