Add ruleset

This commit is contained in:
2026-02-12 14:41:09 +01:00
parent 7c70a9ed04
commit 42444a89d6
4 changed files with 17 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
# Iris: A Space Game
# If you're here to get the ruleset, go to [./RULESET.md](./RULESET.md)
>[!WARNING]
>I have no idea what I'm doing and I'm definitely not a professional

10
RULESET.md Normal file
View File

@@ -0,0 +1,10 @@
# Iris ruleset
## Base systems
### Randomisation
- 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

@@ -22,3 +22,7 @@ uint32_t random_range(uint32_t max) {
} while (r >= threshold);
return r % max;
}
void advance_state(uint32_t n) {
state += n;
}

View File

@@ -6,5 +6,6 @@
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