Solved
What's wrong with this code?
Posted on 2004-10-14
import java.util.*;
import java.math.*;
class dice{
int d1, d2;
Random r;
Dice(int n1, int n2){
d1=n1; d2=n2;
r = new Random();
}
void thro(){
d1 = 1 + r.nextInt(6);
d2 = 1 + r.nextInt(6);
}
public static void main (String[] args){
Dice Pair = new dice(1,1);
Pair.thro;
System.out.println(Pair.d1 + " " + Pair.d2);
}
}
My professor gave me that code and it's not working. I have no idea how to decipher it. When answering please keep in mind that i'm in my third week of class and never programmed before. Any help would be GREATLY appreciated.
Thanks!