|
@@ -1,23 +1,23 @@
|
1
|
|
-# Kris-Tof Dice Toss
|
|
1
|
+# Kris-Tof main.Dice Toss
|
2
|
2
|
|
3
|
|
-Create a `Dice` class that acts like a set of N random-tossed dies.
|
|
3
|
+Create a `main.Dice` class that acts like a set of N random-tossed dies.
|
4
|
4
|
```
|
5
|
|
-Dice dice = new Dice(2); // for craps
|
6
|
|
-Dice dice = new Dice(5); // for yatzee
|
|
5
|
+main.Dice dice = new main.Dice(2); // for craps
|
|
6
|
+main.Dice dice = new main.Dice(5); // for yatzee
|
7
|
7
|
|
8
|
8
|
Integer toss = dice.tossAndSum();
|
9
|
9
|
```
|
10
|
|
-make a couple unit tests for the Dice class.
|
|
10
|
+make a couple unit tests for the main.Dice class.
|
11
|
11
|
|
12
|
|
-Create a tracking class `Bins` that can be used to track the results of dice tosses.
|
|
12
|
+Create a tracking class `main.Bins` that can be used to track the results of dice tosses.
|
13
|
13
|
|
14
|
14
|
```
|
15
|
|
-Bins results = new Bins(2, 12); // for bins from 2..12
|
|
15
|
+main.Bins results = new main.Bins(2, 12); // for bins from 2..12
|
16
|
16
|
Integer numberOfTens = results.getBin(10); // returns the number of tens in the 10 bin
|
17
|
17
|
results.incrementBin(10); // should increment bin # 10
|
18
|
18
|
|
19
|
19
|
```
|
20
|
|
-make a couple unit tests for the Bins class. Your test methods should follow this template:
|
|
20
|
+make a couple unit tests for the main.Bins class. Your test methods should follow this template:
|
21
|
21
|
|
22
|
22
|
in the tests
|
23
|
23
|
Create a new Bin
|
|
@@ -27,7 +27,7 @@ make a couple unit tests for the Bins class. Your test methods should follow thi
|
27
|
27
|
|
28
|
28
|
|
29
|
29
|
|
30
|
|
-Create a `Simulation` class whose Constructor takes arguments:
|
|
30
|
+Create a `main.Simulation` class whose Constructor takes arguments:
|
31
|
31
|
numberOfDies to throw
|
32
|
32
|
numberOfTosses to run
|
33
|
33
|
|
|
@@ -35,7 +35,7 @@ Create a simulation where two dies are thrown *one million times*.
|
35
|
35
|
Keep track of each roll by incrementing the correct Bin.
|
36
|
36
|
|
37
|
37
|
```
|
38
|
|
-Simulation sim = new Simulation(2, 10000);
|
|
38
|
+main.Simulation sim = new main.Simulation(2, 10000);
|
39
|
39
|
|
40
|
40
|
sim.runSimulation();
|
41
|
41
|
|
|
@@ -53,7 +53,7 @@ the results of the sim.printResults() should be an output string that looks like
|
53
|
53
|
|
54
|
54
|
```
|
55
|
55
|
***
|
56
|
|
-Simulation of 2 dice tossed for 1000000 times.
|
|
56
|
+main.Simulation of 2 dice tossed for 1000000 times.
|
57
|
57
|
***
|
58
|
58
|
|
59
|
59
|
2 : 27917: 0.03 **
|