Bläddra i källkod

Update 'README.md'

Kristofer Younger 6 år sedan
förälder
incheckning
ddff637452
1 ändrade filer med 17 tillägg och 6 borttagningar
  1. 17
    6
      README.md

+ 17
- 6
README.md Visa fil

1
 # Kris-Tof Dice Toss
1
 # Kris-Tof Dice Toss
2
 
2
 
3
-Create a Dice class that acts like a set of N random-tossed dies.
3
+Create a `Dice` class that acts like a set of N random-tossed dies.
4
 ```
4
 ```
5
 Dice dice = new Dice(2); // for craps
5
 Dice dice = new Dice(2); // for craps
6
 Dice dice = new Dice(5); // for yatzee
6
 Dice dice = new Dice(5); // for yatzee
9
 ```
9
 ```
10
 make a couple unit tests for the Dice class. 
10
 make a couple unit tests for the Dice class. 
11
 
11
 
12
-Create a tracking class Bins that can be used to track these results.
12
+Create a tracking class `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
 Bins results = new Bins(2, 12); // for bins from 2..12
17
 results.incrementBin(10); // should increment bin # 10
17
 results.incrementBin(10); // should increment bin # 10
18
 
18
 
19
 ```
19
 ```
20
-make a couple unit tests for the Bins class.
20
+make a couple unit tests for the Bins class. Your test methods should follow this template:
21
 
21
 
22
-Create a Simulation class whose Constructor takes arguments:
22
+    in the tests
23
+    Create a new Bin
24
+    increment a bin some number of times in a for loop, say `max = 100;` times,
25
+    then get the Bin value,
26
+    compare the Bin value to `max`, they should be equal.
27
+    
28
+    
29
+
30
+Create a `Simulation` class whose Constructor takes arguments:
23
     numberOfDies to throw
31
     numberOfDies to throw
24
     numberOfTosses to run
32
     numberOfTosses to run
25
 
33
 
26
-Create a simulation where two dies are thrown one million times. Keep track of all results.
34
+Create a simulation where two dies are thrown *one million times*. 
35
+Keep track of each roll by incrementing the correct Bin.
27
 
36
 
28
 ```
37
 ```
29
 Simulation sim = new Simulation(2, 10000);
38
 Simulation sim = new Simulation(2, 10000);
32
 
41
 
33
 sim.printResults();
42
 sim.printResults();
34
 ```
43
 ```
44
+
35
 You can use a main() to run the simulations.
45
 You can use a main() to run the simulations.
36
 
46
 
37
-In your pull requests, create a new file with your name as the filename.
47
+In your pull requests, create a new file with your unique name as the filename.
38
 Paul's would be PaulResults.md
48
 Paul's would be PaulResults.md
39
 
49
 
40
 Paste a copy of your text results into that file and then submit your pull request.
50
 Paste a copy of your text results into that file and then submit your pull request.
59
 12 :    27514: 0.03 **
69
 12 :    27514: 0.03 **
60
 ```
70
 ```
61
 
71
 
72
+Since this is using random when running, your numbers for each Bin may vary.