Skip to content
Snippets Groups Projects
Commit 249d4bf5 authored by clemo's avatar clemo
Browse files

remove gol_setCell


Signed-off-by: default avatarclemo <clemo@cbcode.at>
parent 6d555dc0
No related branches found
No related tags found
No related merge requests found
......@@ -41,13 +41,6 @@ int pMod(int x, int y)
return (x + y) % y;
}
void gol_setCell(gol_t *g, int cell)
{
cell = pMod(cell, g->width * g->height);
div_t d = div(cell, 8);
g->next[d.quot] |= (1 << (7 - d.rem));
}
int getCell(gol_t *g, int cell)
{
cell = pMod(cell, g->width * g->height);
......@@ -135,7 +128,7 @@ void gol_tick(gol_t *g)
//living cell
if (1 < sn && sn < 4)
{
g->next[d.quot] |= (1 << (d.rem));
g->next[d.quot] |= (1 << d.rem);
}
}
else
......@@ -143,7 +136,7 @@ void gol_tick(gol_t *g)
//dead cell
if (sn == 3)
{
g->next[d.quot] |= (1 << (d.rem));
g->next[d.quot] |= (1 << d.rem);
}
}
}
......
......@@ -16,6 +16,5 @@ typedef void (*gol_print_ln)(unsigned int line);
gol_t *gol_setup(int width, int height);
void gol_tick(gol_t *g);
void gol_each(gol_t *g, gol_print_colmn colmn, gol_print_ln ln);
void gol_setCell(gol_t *g, int cell);
void gol_free(gol_t *data);
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment