aboutsummaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorLaytan <laytanlaats@hotmail.com>2024-10-28 20:07:38 +0100
committerLaytan <laytanlaats@hotmail.com>2024-10-28 20:07:38 +0100
commitcb2768625affdd8ec4ee8c0df3b902f40ae620e3 (patch)
tree9150ff468084dfff846ca11d81add2e1f06e31a7 /core/math
parent10c2f8dbeb2126419bfdaadb3d6e21dbbeca0633 (diff)
math/rand: `choice_bit_set` return `not_empty` -> `ok`
Diffstat (limited to 'core/math')
-rw-r--r--core/math/rand/rand.odin6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/rand/rand.odin b/core/math/rand/rand.odin
index a8f274204..474277e84 100644
--- a/core/math/rand/rand.odin
+++ b/core/math/rand/rand.odin
@@ -695,8 +695,8 @@ Inputs:
- set: The `bit_set` to choose a random set bit from
Returns:
-- res: The randomly selected bit, or the zero value if `not_empty` is `false`
-- not_empty: Whether the bit_set was not empty and thus `res` is actually a random set bit
+- res: The randomly selected bit, or the zero value if `ok` is `false`
+- ok: Whether the bit_set was not empty and thus `res` is actually a random set bit
Example:
import "core:math/rand"
@@ -722,7 +722,7 @@ Possible Output:
5 true
*/
@(require_results)
-choice_bit_set :: proc(set: $T/bit_set[$E], gen := context.random_generator) -> (res: E, not_empty: bool) {
+choice_bit_set :: proc(set: $T/bit_set[$E], gen := context.random_generator) -> (res: E, ok: bool) {
total_set := card(set)
if total_set == 0 {
return {}, false