Android Open Source - aSimpleDiceRoller Dice Roller Shared






From Project

Back to project page aSimpleDiceRoller.

License

The source code is released under:

GNU General Public License

If you think the Android project aSimpleDiceRoller listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 *  aSimpleDiceRoller - Simple dice roller application for Android.
 *  Copyright  2012 Elad Alfassa <elad@fedoraproject.org>
 * /*w w  w.  j a  v  a2 s .c om*/
 *  This file is part of aSimpleDiceRoller.
 *
 *   aSimpleDiceRoller is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   aSimpleDiceRoller is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with aSimpleDiceRoller.  If not, see <http://www.gnu.org/licenses/>.

 */

package com.elad.diceroller;

import java.util.Random;

public class DiceRollerShared {
  private static Random rand=new Random();
  public static int rollDice(int size) {
    int min=1, max=size;
    int[] randomArray = new int[100];
    for (int i=0; i<100; i++) {
      randomArray[i]=rand.nextInt(max - min + 1) + min;
    }
    max=99;
    min=0;
    return randomArray[rand.nextInt(max - min + 1) + min];
    
  }

}




Java Source Code List

com.elad.diceroller.ASimpleDiceRollerActivity.java
com.elad.diceroller.DiceListActivity.java
com.elad.diceroller.DiceRollerShared.java
com.elad.diceroller.NerdmodeActivity.java
com.elad.diceroller.StringUtils.java