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',
69
69
console .log (" Toss: " , flipSelector .select ());
70
70
```
71
71
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)
73
73
``` 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
+ }
74
85
```
75
86
5. Simulating wheel of fortune:
76
87
![ Image Wheel of Fortune] ( ./doc/img/wheel_fortune.jpg )
@@ -93,7 +104,7 @@ var fortuneWheel = selectorFactory.createFrequencySelectorWithReplacement(
93
104
console .log (" Prize: " , fortuneWheel .select ());
94
105
```
95
106
``` 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)
97
108
var realWheel = selectorFactory .createFrequencySelectorWithReplacement (
98
109
[[' 1000$' , 50 ]
99
110
, [' 10$' , 5000 ]
You can’t perform that action at this time.
0 commit comments