diff --git a/src/base.h b/src/base.h index 143384e..653ebc3 100644 --- a/src/base.h +++ b/src/base.h @@ -39,8 +39,8 @@ typedef double f64; #define NUM_PROGRAMS_POW_2 8 #define NUM_PROGRAMS (1 << NUM_PROGRAMS_POW_2) -#define MUTATION_CHANCE 0 -#define MUTATION_OFFSET 2 +#define MUTATION_CHANCE 10000 +#define MUTATION_OFFSET 3 #endif diff --git a/src/simulation.c b/src/simulation.c index bae71cc..731ab00 100644 --- a/src/simulation.c +++ b/src/simulation.c @@ -29,7 +29,7 @@ void simulation_iterate(simulation_t *sim) #if MUTATION_CHANCE for (u64 i = 0; i < SIMULATION_SIZE; ++i) { - if ((rand() % MUTATION_CHANCE) == 0) + if ((rand() % MUTATION_CHANCE) == (MUTATION_CHANCE - 1)) { sim->memory[i] += (rand() % MUTATION_OFFSET) - (MUTATION_OFFSET / 2); }