summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorHybridDog <3192173+HybridDog@users.noreply.github.com>2020-02-01 16:09:45 +0100
committerGitHub <noreply@github.com>2020-02-01 16:09:45 +0100
commitea5e231959365622607c8bfd953f6d96ec54a394 (patch)
tree67f379b77141ed94d5b37c87aac399e6a5ac01f6 /doc/lua_api.txt
parent2b3490db1f0e99a427e34135770f8e5afcf275ce (diff)
downloadminetest-ea5e231959365622607c8bfd953f6d96ec54a394.tar.gz
minetest-ea5e231959365622607c8bfd953f6d96ec54a394.tar.bz2
minetest-ea5e231959365622607c8bfd953f6d96ec54a394.zip
Add table.shuffle (#8299)
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 80b694ee9..6b8dcb5fc 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -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