I have this Die class, which I am working on for a game called Craps. My old method works, but I wanted to try to use dice with a higher number than 6. I can get the program to accept my user input, but how can I get it to print out the value of 'value'? My current println method isn't working, as the compiler just skips it. Does anyone have any suggestions?
import java.util.Scanner;
public class Die
{
private int value;
private int faces;
public static void main(String[] args)
{
System.out.print("Enter a value for n:" );
Scanner kboard = new Scanner (System.in);
int n = kboard.nextInt();
}
public void roll()
{
value = (1 + (int) (6 * Math.random()));
}
public void roll(int n)
{
value = (1 + (int) (n * Math.random()));
}
public int getNumDots()
{
System.out.println(value);
return value;
}
}