From a8cf10b0b523bf4c3234be29b0dd51e719cb00c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Wed, 17 Jan 2024 21:48:17 +0100 Subject: [PATCH] Docs: Recommend against using PseudoRandom --- doc/lua_api.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/lua_api.md b/doc/lua_api.md index c7be3b0c3..1f62e46a0 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -8180,6 +8180,11 @@ Can be obtained using `player:get_meta()`. A 16-bit pseudorandom number generator. Uses a well-known LCG algorithm introduced by K&R. +> [!NOTE] +> `PseudoRandom` is slower and has worse random distribution than `PcgRandom`. +> Use `PseudoRandom` only if you need output to match the well-known LCG algorithm introduced by K&R. +> Otherwise, use `PcgRandom`. + * constructor `PseudoRandom(seed)` * `seed`: 32-bit signed number