Coin
Represents a standard coin.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
Properties
.result READ ONLY
The result of the coin flip.
Type:
String
Methods
.flip()
Flips the coin and returns either "heads" or "tails" at an equal chance.
Returns:
String
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
Die
Represents a multi-faced die.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
Properties
.value READ ONLY
The result of the latest dice roll.
Type:
Number
.faces READ ONLY
The number of faces on the die.
Type:
Number
Methods
.roll()
Re-rolls the die and returns a random number between 1 and the number of faces on the die.
Returns:
Number
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
D4
Extends Die
Represents a 4 sided die.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
D6
Extends Die
Represents a 6 sided die.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
D8
Extends Die
Represents a 8 sided die.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
D10
Extends Die
Represents a 10 sided die.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
D12
Extends Die
Represents a 12 sided die.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
D20
Extends Die
Represents a 20 sided die.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |
D100
Extends Die
Represents a 100 sided die.
Constructor
Argument | Type | Description | Optional |
---|---|---|---|
N/A | N/A | N/A | N/A |