2020-06-25 05:51:09 +00:00
|
|
|
# random
|
|
|
|
|
|
|
|
Use `random` to generate random values
|
|
|
|
|
2020-06-26 04:51:05 +00: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 04:12:51 +00: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 04:24:28 +00:00
|
|
|
```shell
|
2020-08-11 21:42:59 +00:00
|
|
|
> random dice --dice 1024 --sides 16 | histogram | sort-by count
|
|
|
|
────┬───────┬───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
|
|
# │ value │ count │ frequency
|
|
|
|
────┼───────┼───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
|
|
0 │ 14 │ 54 │ **********************************************************************
|
|
|
|
1 │ 4 │ 55 │ ***********************************************************************
|
|
|
|
2 │ 10 │ 58 │ ***************************************************************************
|
|
|
|
3 │ 15 │ 59 │ ****************************************************************************
|
|
|
|
4 │ 11 │ 60 │ *****************************************************************************
|
|
|
|
5 │ 7 │ 60 │ *****************************************************************************
|
|
|
|
6 │ 16 │ 61 │ *******************************************************************************
|
|
|
|
7 │ 5 │ 62 │ ********************************************************************************
|
|
|
|
8 │ 3 │ 63 │ *********************************************************************************
|
|
|
|
9 │ 9 │ 63 │ *********************************************************************************
|
|
|
|
10 │ 2 │ 64 │ ***********************************************************************************
|
|
|
|
11 │ 8 │ 68 │ ****************************************************************************************
|
|
|
|
12 │ 1 │ 71 │ ********************************************************************************************
|
|
|
|
13 │ 13 │ 73 │ **********************************************************************************************
|
|
|
|
14 │ 6 │ 76 │ **************************************************************************************************
|
|
|
|
15 │ 12 │ 77 │ ****************************************************************************************************
|
|
|
|
────┴───────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────
|
2020-07-02 04:24:28 +00:00
|
|
|
```
|
|
|
|
|
2020-06-30 04:12:51 +00:00
|
|
|
## uuid
|
|
|
|
|
|
|
|
* `random uuid`: Generate a random uuid4 string
|
|
|
|
|
|
|
|
### uuid Examples
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> random uuid
|
|
|
|
8af4de39-acbc-42f0-94d1-7cfad6c01f8b
|
|
|
|
```
|