(main)+colouring for differing sandpile proportions
Based on Wikipedia page colouring.
This commit is contained in:
13
main.c
13
main.c
@@ -61,8 +61,19 @@ int main(void)
|
|||||||
for (size_t i = 0; i < state.dwidth; ++i)
|
for (size_t i = 0; i < state.dwidth; ++i)
|
||||||
for (size_t j = 0; j < state.dwidth; ++j)
|
for (size_t j = 0; j < state.dwidth; ++j)
|
||||||
{
|
{
|
||||||
|
Color c = {0};
|
||||||
|
unsigned char sandpile = state.data[(i * state.dwidth) + j];
|
||||||
|
if (sandpile == 0)
|
||||||
|
c = BLACK;
|
||||||
|
else if (sandpile == 1)
|
||||||
|
c = GREEN;
|
||||||
|
else if (sandpile == 2)
|
||||||
|
c = PURPLE;
|
||||||
|
else if (sandpile == 3)
|
||||||
|
c = YELLOW;
|
||||||
|
|
||||||
DrawRectangle(i * state.multiplier, j * state.multiplier,
|
DrawRectangle(i * state.multiplier, j * state.multiplier,
|
||||||
state.multiplier, state.multiplier, BLACK);
|
state.multiplier, state.multiplier, c);
|
||||||
}
|
}
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user