dtalley11

Dicedriver.java

Jul 1st, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. package com.dndmud.dice;
  2. import java.util.*;
  3.  
  4. public class Dicedriver {
  5.  
  6.     public static void main(String[] args) {
  7.         if (args[0] == "help" && args.length == 0 || args[0] == "/help" && args.length == 0 || args.length < 1 ) {
  8.             System.out.println("\r\nDice Roll Needs 2 Arguments");
  9.             System.out.println("\r\njava dice x y'");
  10.             System.out.println("\r\nWhere x is the amount of dice you wish to roll, and y is the amount of sides on the die/dice");
  11.             System.exit(0);
  12.         }
  13.         int num = Integer.parseInt(args[0]);
  14.         int size = Integer.parseInt(args[1]);
  15.         System.out.println("Rolling "+ num + "d" + size);
  16.         List<Integer> list2 = new com.dndmud.dice.Dice(size,num);
  17.         if (num == 1) {
  18.             System.out.println("Your Rolled a " + list2.get(0));
  19.         }
  20.         else {
  21.             System.out.print("Your Rolled a " + list2.get(0) + " ");
  22.             list2.remove(0);
  23.             System.out.print(list2);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment