File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,19 @@ var flipSelector = selectorFactory.createSimpleSelectorWithReplacement(['Head',
6969console .log (" Toss: " , flipSelector .select ());
7070```
7171
72- 5. [https://en.wikipedia.org/wiki/He_loves_me..._he_loves_me_not]
72+ 5. [https://en.wikipedia.org/wiki/He_loves_me..._he_loves_me_not](https://en.wikipedia.org/wiki/He_loves_me..._he_loves_me_not)
7373``` javascript
74+ var daisy = selectorFactory .createSimpleSelectorWithoutReplacement ([]);
75+ for (let i= 0 ;i < daisy .getRandomer ().getRandomIntBetween (4 , 8 );i++ )
76+ {
77+ daisy .getElements ().push (' petal' );
78+ }
79+ var meter = true ;
80+ while (daisy .select ()!= null )
81+ {
82+ meter = ! meter;
83+ console .log (meter? ' He loves me' : ' He loves me not' );
84+ }
7485```
7586 5. Simulating wheel of fortune:
7687![ Image Wheel of Fortune] ( ./doc/img/wheel_fortune.jpg )
@@ -93,7 +104,7 @@ var fortuneWheel = selectorFactory.createFrequencySelectorWithReplacement(
93104console .log (" Prize: " , fortuneWheel .select ());
94105```
95106``` javascript
96- // /A cheated wheel with 0.5% chance to get 1000$, 50 % chance to get 10$, 49.5% to get stuck (select return null)
107+ // /A cheated wheel with 0.5% chance to get 1000$, 50 % chance to get 10$, 49.5% to get stuck (return null)
97108var realWheel = selectorFactory .createFrequencySelectorWithReplacement (
98109 [[' 1000$' , 50 ]
99110 , [' 10$' , 5000 ]
You can’t perform that action at this time.
0 commit comments