mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Add table.shuffle (#8299)
This commit is contained in:
parent
2b3490db1f
commit
ea5e231959
2 changed files with 21 additions and 0 deletions
|
@ -2925,6 +2925,13 @@ Helper functions
|
|||
find new indices.
|
||||
* `table.key_value_swap(t)`: returns a table with keys and values swapped
|
||||
* If multiple keys in `t` map to the same value, the result is undefined.
|
||||
* `table.shuffle(table, [from], [to], [random_func])`:
|
||||
* Shuffles elements `from` to `to` in `table` in place
|
||||
* `from` defaults to `1`
|
||||
* `to` defaults to `#table`
|
||||
* `random_func` defaults to `math.random`. This function receives two
|
||||
integers as arguments and should return a random integer inclusively
|
||||
between them.
|
||||
* `minetest.pointed_thing_to_face_pos(placer, pointed_thing)`: returns a
|
||||
position.
|
||||
* returns the exact position on the surface of a pointed node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue