Skip to content

Commit

Permalink
docs(random): Remove Game wrapper in examples (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis authored Aug 28, 2020
1 parent 18ed97c commit 84714c5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/documentation/random.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ The die roll value (or an array of values if `diceCount` is greater than `1`).
#### Usage

```js
const game = Game({
const game = {
moves: {
move(G, ctx) {
const die = ctx.random.Die(6); // die = 1-6
const dice = ctx.random.Die(6, 3); // dice = [1-6, 1-6, 1-6]
...
},
}
});
};
```

### 2. Number
Expand All @@ -83,14 +83,14 @@ Returns a random number between `0` and `1`.
#### Usage

```js
const game = Game({
const game = {
moves: {
move(G, ctx) {
const n = ctx.random.Number();
...
},
}
});
};
```

### 3. Shuffle
Expand All @@ -106,13 +106,13 @@ The shuffled array.
#### Usage

```js
const game = Game({
const game = {
moves: {
move(G, ctx) {
G.deck = ctx.random.Shuffle(G.deck);
},
},
});
};
```

### 4. Wrappers
Expand All @@ -127,12 +127,12 @@ const game = Game({
#### Usage

```js
const game = Game({
const game = {
moves: {
move(G, ctx) {
const die = ctx.random.D6();
...
},
}
});
};
```

0 comments on commit 84714c5

Please sign in to comment.