2020-06-25 07:51:09 +02:00
|
|
|
# random
|
|
|
|
|
|
|
|
Use `random` to generate random values
|
|
|
|
|
2020-06-26 06:51:05 +02:00
|
|
|
## bool
|
|
|
|
|
|
|
|
* `random bool`: Generate a random boolean value
|
|
|
|
|
|
|
|
### bool Flags
|
|
|
|
|
|
|
|
* `-b`, `--bias` \<number>: Adjusts the probability of a "true" outcome
|
|
|
|
|
|
|
|
### bool Examples
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> random bool
|
|
|
|
false
|
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> random bool --bias 0.75
|
|
|
|
true
|
|
|
|
```
|
2020-06-30 06:12:51 +02:00
|
|
|
|
|
|
|
## dice
|
|
|
|
|
|
|
|
* `random dice`: Generate a random dice roll
|
|
|
|
|
|
|
|
### dice Flags
|
|
|
|
|
|
|
|
* `d`, `--dice` \<integer>: The amount of dice being rolled
|
|
|
|
* `s`, `--sides` \<integer>: The amount of sides a die has
|
|
|
|
|
|
|
|
### dice Examples
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> random dice
|
|
|
|
4
|
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> random dice -d 10 -s 12
|
|
|
|
───┬────
|
|
|
|
0 │ 11
|
|
|
|
1 │ 11
|
|
|
|
2 │ 11
|
|
|
|
3 │ 11
|
|
|
|
4 │ 5
|
|
|
|
5 │ 3
|
|
|
|
6 │ 10
|
|
|
|
7 │ 7
|
|
|
|
8 │ 3
|
|
|
|
9 │ 1
|
|
|
|
───┴────
|
|
|
|
```
|
|
|
|
|
2020-07-02 06:24:28 +02:00
|
|
|
```shell
|
|
|
|
> random dice --dice 1024 --sides 16 | wrap dice | histogram dice | sort-by count
|
|
|
|
────┬──────┬───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
|
|
# │ dice │ count │ frequency
|
|
|
|
────┼──────┼───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
|
|
0 │ 15 │ 54 │ ***********************************************************************
|
|
|
|
1 │ 7 │ 55 │ ************************************************************************
|
|
|
|
2 │ 1 │ 56 │ *************************************************************************
|
|
|
|
3 │ 16 │ 57 │ ***************************************************************************
|
|
|
|
4 │ 5 │ 57 │ ***************************************************************************
|
|
|
|
5 │ 3 │ 61 │ ********************************************************************************
|
|
|
|
6 │ 11 │ 62 │ *********************************************************************************
|
|
|
|
7 │ 14 │ 64 │ ************************************************************************************
|
|
|
|
8 │ 9 │ 65 │ *************************************************************************************
|
|
|
|
9 │ 12 │ 66 │ **************************************************************************************
|
|
|
|
10 │ 4 │ 67 │ ****************************************************************************************
|
|
|
|
11 │ 2 │ 69 │ ******************************************************************************************
|
|
|
|
12 │ 8 │ 69 │ ******************************************************************************************
|
|
|
|
13 │ 6 │ 71 │ *********************************************************************************************
|
|
|
|
14 │ 13 │ 75 │ **************************************************************************************************
|
|
|
|
15 │ 10 │ 76 │ ****************************************************************************************************
|
|
|
|
────┴──────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
|
|
```
|
|
|
|
|
2020-06-30 06:12:51 +02:00
|
|
|
## uuid
|
|
|
|
|
|
|
|
* `random uuid`: Generate a random uuid4 string
|
|
|
|
|
|
|
|
### uuid Examples
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> random uuid
|
|
|
|
8af4de39-acbc-42f0-94d1-7cfad6c01f8b
|
|
|
|
```
|