Throw of a die in Java
- by Arkapravo
The throw of a die is a popular program in Java,
public class Die {
/* This program simulates rolling a die */
public static void main(String[] args) {
int die; // The number on the die.
die = (int)(Math.random()*6 + 1);
System.out.println (die);
} // end main()
} // end class
What I wish to do is make it repeat, 500 times. I have not been able to put this program into a loop of 500. I usually program in Python, thus I guess my Java has rusted !
Any help is most welcome !