com.anji.roshambo
Class Coin

java.lang.Object
  extended bycom.anji.roshambo.Coin

public class Coin
extends java.lang.Object

http://www.cs.unimaas.nl/~donkers/games/roshambo03/


Constructor Summary
Coin()
           
 
Method Summary
static int flip()
          flip unbiased coin ROCK, PAPER or SCISSORS:
static int flip(double pr)
          flip biased coin: pr = probability of getting 1
static int flip(double pr_rock, double pr_paper)
          flip biased coin:
static void setRand(java.util.Random aRand)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Coin

public Coin()
Method Detail

flip

public static int flip(double pr)
flip biased coin: pr = probability of getting 1

Parameters:
pr - probability of returning 1
Returns:
0 or 1

flip

public static int flip(double pr_rock,
                       double pr_paper)
flip biased coin:

Parameters:
pr_rock - = probability of getting ROCK
pr_paper - = probability of getting PAPER
Returns:
RoshamboPlayer.ROCK,RoshamboPlayer.PAPER, or RoshamboPlayer.SCISSORS

flip

public static int flip()
flip unbiased coin ROCK, PAPER or SCISSORS:

Returns:
0, 1, or 2

setRand

public static void setRand(java.util.Random aRand)
Parameters:
aRand - new random object