Skip to content
Snippets Groups Projects
Commit d3ec21c3 authored by Leonardo Krambeck's avatar Leonardo Krambeck
Browse files

arruma bug do usleep dentro da printGeneration e do contador i das celulas

parent 5184c905
Branches
No related tags found
No related merge requests found
......@@ -148,7 +148,7 @@ void addCell (game_t *game, int* i)
if (game->this.generation[x-1][y-1] == DEAD)
{
game->this.generation[x-1][y-1] = ALIVE;
i++;
(*i)++;
}
else
......@@ -177,7 +177,7 @@ void removeCell (game_t *game, int* i)
if (game->this.generation[x-1][y-1] == ALIVE)
{
game->this.generation[x-1][y-1] = DEAD;
i++;
(*i)--;
}
else
......@@ -218,9 +218,13 @@ void playGame (game_t *game)
incrementGeneration (game);
usleep (game->cycleTime);
printGeneration (game);
}
printf ("That's all folks!");
sleep (3);
clear();
......@@ -276,7 +280,6 @@ void printGeneration (game_t *game)
printf (" ");
printf ("\n");
usleep (game->cycleTime);
}
/* Checks if the status of a Cell in the next generation. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment