#Conway's game of life
1 messages · Page 1 of 1 (latest)
i have the ccode in this one
Can you shof me
The code you provided does not contain an explicit exit or quit mechanism. The loop that waits for the spacebar to be pressed should continue until any other key is pressed. However, there are a couple of issues in your code that might be causing unexpected behavior:
The countAliveNeighbors function is checking if grid[rows + i][cols + j] is equal to 1 instead of checking if it's equal to the ALIVE character ('*'). Update the condition to if (grid[rows + i][cols + j] == ALIVE).
The Autoplay function calls Sleep(50) after the loop, which pauses the program for 50 milliseconds. This might not be necessary and could potentially cause unexpected behavior.
To further investigate and fix the issue you're experiencing, could you provide more details about the problem? What exactly happens when the game quits? Are there any error messages displayed? Additionally, please check if there is any other code or logic in your program that could potentially cause the program to exit unexpectedly.