simulation: separate out mutation into its own function
This commit is contained in:
@@ -23,9 +23,8 @@ static const Color possible_colors[] = {
|
|||||||
['\0'] = {0x0, 0x0, 0x0, 0xff},
|
['\0'] = {0x0, 0x0, 0x0, 0xff},
|
||||||
};
|
};
|
||||||
|
|
||||||
void simulation_iterate(simulation_t *sim)
|
void simulation_mutate(simulation_t *sim)
|
||||||
{
|
{
|
||||||
// Mutate cells if an option
|
|
||||||
#if MUTATION_CHANCE
|
#if MUTATION_CHANCE
|
||||||
for (u64 i = 0; i < SIMULATION_SIZE; ++i)
|
for (u64 i = 0; i < SIMULATION_SIZE; ++i)
|
||||||
{
|
{
|
||||||
@@ -35,7 +34,10 @@ void simulation_iterate(simulation_t *sim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void simulation_iterate(simulation_t *sim)
|
||||||
|
{
|
||||||
u64 a = 0, b = 0;
|
u64 a = 0, b = 0;
|
||||||
while (a == b)
|
while (a == b)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ typedef struct
|
|||||||
bf_token memory[SIMULATION_SIZE];
|
bf_token memory[SIMULATION_SIZE];
|
||||||
} simulation_t;
|
} simulation_t;
|
||||||
|
|
||||||
|
void simulation_mutate(simulation_t *sim);
|
||||||
void simulation_iterate(simulation_t *sim);
|
void simulation_iterate(simulation_t *sim);
|
||||||
void simulation_draw(simulation_t *sim);
|
void simulation_draw(simulation_t *sim);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user