Add ruleset
This commit is contained in:
@@ -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
10
RULESET.md
Normal 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**
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user