Back to project page TokenTracker.
The source code is released under:
GNU General Public License
If you think the Android project TokenTracker listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ekflagristoj.tokentracker.util; //from w w w . j a va 2s . com import java.util.Random; public class Randomizer { private Random randomizer; public String flipCoin() { return ( ( randomizer.nextInt(2) == 1 ) ? "h" : "t" ); } public int rollDie( int faces ) { return ( randomizer.nextInt( faces ) + 1 ); } public Randomizer() { this.randomizer = new Random(); } }