quote:Into a windshield?
Well, I didn't think there'd be much interest to be honest. But apparently there is, so I won't send it the way of other mayflies.
quote:That sounds like the Devil! to me, Storm Saxon. Nothankyou, no sir!
You could always get one of those electronic dice doohickies what rolls every die under the sun.
quote:A decent spreadsheet program (e.g. MS Excel) would also do the trick.
Originally posted by Storm Saxon:
You could always get one of those electronic dice doohickies what rolls every die under the sun.
quote:erosomniac and his roommate were eventually successful in executing above plans.
Originally posted by erosomniac:
I'd also like to know! Not that I'm planning on, you know, forcefeeding tabletopping to my friends or anything.
o_O
code:import java.util.Random;
public class Die {
int numberSides;
public Die(int numberSides){
this.numberSides = numberSides;
}
public int roll(){
return new Random().nextInt(numberSides) + 1;
}
}
code:public class DieSet {
Die die;
int numberOfDice;
public DieSet(int numberOfSides){
this(numberOfSides,1);
}
public DieSet(int numberOfSides, int numberOfDice){
die = new Die(numberOfSides);
this.numberOfDice = numberOfDice;
}
public int roll(){
int total = 0;
for(int i = 0; i < numberOfDice; i++){
total+=die.roll();
}
return total;
}
}
code:public class Tester {
private static final int ROLLS = 1000000;
public static double getAverage(int numberOfSides){
return getAverage(new DieSet(numberOfSides));
}
public static double getAverage(int numberOfSides, int numberOfDice){
return getAverage(new DieSet(numberOfSides,numberOfDice));
}
public static double getAverage(DieSet dieSet){
int total = 0;
for(int i = 0; i < ROLLS; i++){
total += dieSet.roll();
}
double average = (double)total / ROLLS;
return average;
}
public static void main(String[] args){
System.out.println("1d4: "+getAverage(4));
System.out.println("1d6: "+getAverage(6));
System.out.println("1d8: "+getAverage(8));
System.out.println("2d4: "+getAverage(4,2));
System.out.println("1d10: "+getAverage(10));
System.out.println("1d12: "+getAverage(12));
System.out.println("2d6: "+getAverage(6,2));
System.out.println("3d4: "+getAverage(4,3));
System.out.println("2d8: "+getAverage(8,2));
System.out.println("4d4: "+getAverage(4,4));
System.out.println("3d6: "+getAverage(6,3));
System.out.println("1d20: "+getAverage(20));
}
}
quote:What Vegas table uses d20s though?
Originally posted by Artemisia Tridentata:
What? You buy dice? I thought you just picked up a couple of comp pair the next time you were in a casino. Well, this is Nevada. Buying dice here would be like buying kittens.
quote:I just use a roulette wheel and respin if the result is higher/lower than I need.
Originally posted by scholarette:
quote:What Vegas table uses d20s though?
Originally posted by Artemisia Tridentata:
What? You buy dice? I thought you just picked up a couple of comp pair the next time you were in a casino. Well, this is Nevada. Buying dice here would be like buying kittens.