diff --git a/GameOfLife.c b/GameOfLife.c index 36884565246c44d78a2fbbad4700427b15fd2f1d..cb02cd8066bc99f92f1e4bf1bdd05aaf5fb77612 100644 --- a/GameOfLife.c +++ b/GameOfLife.c @@ -108,7 +108,7 @@ void memoryAlloc (game_t *game) game->next.generation[i] = (int *) calloc ( game->next.cols, sizeof (int) ); } - +/* Setup the first generation with the user inputs */ void firstGeneration (game_t *game) { int i=1; @@ -128,7 +128,7 @@ void firstGeneration (game_t *game) else if (input[0] == 'k' && strlen(input) == 1) removeCell (game, &i); - else if (input[0] != 's' && strlen(input) != 1) + else if (input[0] != 's' || strlen(input) != 1) { printf ("\nInvalid input, try again."); sleep (2);