Skip to content

Commit 3dcbf7f

Browse files
authored
Fix Random.weighted bug in the concept doc: weight is the first element of the tuple (#729)
1 parent cee7a88 commit 3dcbf7f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

concepts/random/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ generate 5 (Random.uniform Red [Green, Blue])
8484
We can also tweak the probabilities using `Random.weighted`:
8585

8686
```elm
87-
generate 5 (Random.weighted (Red, 80) [(Green, 15), (Blue, 5)])
87+
generate 5 (Random.weighted (80, Red) [(15, Green), (5, Blue)])
8888
--> [Red, Red, Green, Red, Red]
8989
```
9090

concepts/random/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ generate 5 (Random.uniform Red [Green, Blue])
5757
We can also tweak the probabilities using `Random.weighted`:
5858

5959
```elm
60-
generate 5 (Random.weighted (Red, 80) [(Green, 15), (Blue, 5)])
60+
generate 5 (Random.weighted (80, Red) [(15, Green), (5, Blue)])
6161
--> [Red, Red, Green, Red, Red]
6262
```
6363

0 commit comments

Comments
 (0)