This commit is contained in:
2026-02-13 13:12:01 +01:00
parent 91e5b648b6
commit d4ee28c2e1
4 changed files with 3 additions and 11 deletions

View File

@@ -6,5 +6,3 @@
- Iris uses xorshift32 for randomisation.
- The seed is set once at the beginning through user input. You can add more ways to set the seed, but the user has to be able to set it themselves.
- Every randomisation advances the state by 1
- Every specified action and advances the state by the specified amount, if an amount is specified. If not, it **doesn't advance the state**

View File

@@ -3,7 +3,8 @@
int main() {
set_random_seed(1842);
uint32_t num = random_u32();
printf("%u\n", num);
for (int i = 0; i < 10; i++) {
printf("%u\n", random_u32());
}
return 0;
}

View File

@@ -22,9 +22,3 @@ uint32_t random_range(uint32_t max) {
} while (r >= threshold);
return r % max;
}
void advance_state(uint32_t n) {
for (uint32_t i = 0; i < n; i++) {
random_u32();
}
}

View File

@@ -6,6 +6,5 @@
void set_random_seed(uint32_t seed);
uint32_t random_u32(void);
uint32_t random_range(uint32_t max);
void advance_state(uint32_t n);
#endif