package wip
This commit is contained in:
22
math/docs/random/random.md
Normal file
22
math/docs/random/random.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# math_Random
|
||||
Generate a random integer in the range provided.
|
||||
**IMPORTANT:** math_Random is **NOT** cryptographically secure! Use the `cryptography` library instead!
|
||||
If you want to generate a random double, use `math_RandomDouble`.
|
||||
|
||||
## Arguments
|
||||
- min (int): Smallest possible number
|
||||
- max (int): Largest possible number
|
||||
|
||||
## Returns
|
||||
randomNumber (int): A random number in the range provided
|
||||
|
||||
## Example
|
||||
```python
|
||||
call !math_Random 1 6 &dice
|
||||
println $dice # 3
|
||||
call !math_Random 1 6 &dice
|
||||
println $dice # 2
|
||||
call !math_Random 1 6 &dice
|
||||
println $dice # 6
|
||||
...
|
||||
```
|
||||
22
math/docs/random/random_double.md
Normal file
22
math/docs/random/random_double.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# math_RandomDouble
|
||||
Generate a random double in the range provided.
|
||||
**IMPORTANT:** math_RandomDouble is **NOT** cryptographically secure! Use the `cryptography` library instead!
|
||||
If you want to generate a random integer, use `math_Random`.
|
||||
|
||||
## Arguments
|
||||
- min (double): Smallest possible number
|
||||
- max (double): Largest possible number
|
||||
|
||||
## Returns
|
||||
randomNumber (double): A random number in the range provided
|
||||
|
||||
## Example
|
||||
```python
|
||||
call !math_RandomDouble 0.0 10.0 &randomNumber
|
||||
println $randomNumber # 5.24...
|
||||
call !math_RandomDouble 0.0 10.0 &randomNumber
|
||||
println $randomNumber # 6.58...
|
||||
call !math_RandomDouble 0.0 10.0 &randomNumber
|
||||
println $randomNumber # 9.22...
|
||||
...
|
||||
```
|
||||
20
math/docs/random/random_set_seed.md
Normal file
20
math/docs/random/random_set_seed.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# math_RandomSetSeed
|
||||
Seed the pseudo random number generator.
|
||||
Seeding the random number generator the same number will always yield the same random number.
|
||||
|
||||
## Arguments
|
||||
- seed (int): Seed
|
||||
|
||||
## Returns
|
||||
math_RandomSetSeed does not return anything.
|
||||
|
||||
## Example
|
||||
```python
|
||||
call !math_RandomSetSeed 123 &
|
||||
call !math_Random 1 6 &dice
|
||||
println $dice # some number
|
||||
call !math_RandomSetSeed 123 &
|
||||
call !math_Random 1 6 &dice
|
||||
println $dice # the same number
|
||||
# (i cant test this cause libraries are broken as am i writing docs lmao)
|
||||
```
|
||||
Reference in New Issue
Block a user