Very well
Code:
package probdraw;
public class Probdraw
{
public static void main(String[] args)
{
int N = Integer.parseInt(args[0]);
double p = Double.parseDouble(args[1]);
int r = 5;
double theta = 2*Math.PI/N;
StdDraw.setXscale(-r-2, r+2);
StdDraw.setYscale(-r-2, r+2);
for(int i = 0; i < N; i++)
{
StdDraw.point(r*Math.cos(i*theta),r*Math.sin(i*theta));
}
for(int i = 0; i < N; i++)
{
for(int j = i; j < N; j++)
{
if(Math.random() < p)
{
StdDraw.line(r*Math.cos(i*theta),r*Math.sin(i*theta),r*Math.cos(j*theta),r*Math.sin(j*theta));
}
}
}
}
}
Error Message:
Probdraw.java:14: error: cannot find symbol
StdDraw.setXscale(-r-2, r+2);
^
symbol: variable StdDraw
location: class Probdraw
Probdraw.java:15: error: cannot find symbol
StdDraw.setYscale(-r-2, r+2);
^
symbol: variable StdDraw
location: class Probdraw
Probdraw.java:19: error: cannot find symbol
StdDraw.point(r*Math.cos(i*theta),r*Math.sin(i*theta));
^
symbol: variable StdDraw
location: class Probdraw
Probdraw.java:28: error: cannot find symbol
StdDraw.line(r*Math.cos(i*theta),r*Math.sin(i*theta),r*Math.cos(j*theta),r*Math.sin(j*theta));
^
symbol: variable StdDraw
location: class Probdraw
4 errors
Command used is using a very basic level of terminal and is most probably wrong: javac -cp . probdraw.java
and tried: javac -cp "." probdraw.java
and tried: javac -cp "~/Desktop/DropBox/Programming/.../StdDraw.class" probdraw.java
and tried: javac -cp ~/Desktop/DropBox/Programming/.../StdDraw.class probdraw.java
where ... isn't what I used I obviously specified it exactly. I do know that java is case sensitive and I used the correct spelling. Also with java it's supposed to pick up the classes in the folder so I shouldn't have to specify anything. My real question is why isn't it doing that? I downloaded the latest JDK and restarted and it's still being extremely aggravating.
----------
Yes that is the Library I was using to do the work. Thanks for the reply.