Skip to content

Commit 7277156

Browse files
committed
update demo & doc
1 parent 6d98c18 commit 7277156

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,19 @@ var flipSelector = selectorFactory.createSimpleSelectorWithReplacement(['Head',
6969
console.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(
93104
console.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)
97108
var realWheel = selectorFactory.createFrequencySelectorWithReplacement(
98109
[['1000$', 50]
99110
, ['10$', 5000]

0 commit comments

Comments
 (0)