dtalley11

Diceroll

Jun 30th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. import java.util.Random;
  2. class main {
  3.     public static void main(String[] args) {
  4.         int size = Integer.parseInt(args[0]);
  5.         System.out.println(size);
  6.         System.out.println(main.DiceRoll(size));
  7.     }
  8.     public static int DiceRoll(int size) {
  9.         Random generator = new Random();
  10.         int finroll = generator.nextInt(size) + 1;
  11.         return (finroll);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment