Question: Task For this project, you will be coding a simple cellular automata game, called Conway's Game of Life. In this game, you have a grid

Task For this project, you will be coding a simple cellular automata game, called Conway's Game of Life. In this game, you have a grid where pixels can either be on or off (dead or alive). In the game, as time marches on, there are simple rules that govern whether each pixel will be on or off (dead or alive) at the next time step. Coding Standards Prior to this assignment, you should be familiar with the entirety of the Coding Standards, available on Blackboard under Assignments and linked on the course website at the top of the Assignments page. You should be commenting your code, and using constants in your code (not magic numbers or strings). Any numbers other than 0 or 1 are magic numbers! Any strings with a meaning (e.g., alive or dead) should be constants! You will lose major points if you do not follow the 201 coding standards. If you have questions about commenting, whitespace, or any other coding standards, please come to office hours. CMSC 201 Computer Science I for Majors Page 4 Additional Specifications For this assignment, you must create and call at least five individual functions, not including main(). All other design decisions are up to you. You may not import any libraries or use any library functions! Doing so will lose you a very large number of points. Input Validation For this project, we will require that you validate input from the user. You can assume that the user will enter the right type of input, but not that they will enter a correct value. In other words, a user will always give an integer when you expect one, but it may be a negative or otherwise invalid value. You will need to validate the following things: Getting the numbers of rows and columns o Rows must be 1 or greater o Columns must be 1 or greater Getting the cells that will start the game off as alive o The row must be either The character q (for quit) If the user enters any other character, it is fine for the program to crash A valid index for the number of rows your board has (i.e., it starts at index 0, and goes up to index row_size 1) o The column must be A valid index for the number of columns your board has (i.e., it starts at index 0, and goes up to index column_size 1) Getting the number of iterations to run o Must be 0 or greater (They can choose to run no iterations, in which case you would only print the starting board) See the sample output for examples of how this should work in your program. CMSC 201 Computer Science I for Majors Page 5 Details For this project, you will be coding a simple cellular automata game, called Conway's Game of Life. In this game, you have a grid where pixels can either be on or off (dead or alive). In the game, as time marches on, there are simple rules that govern whether each pixel will be on or off (dead or alive) at the next time step. These rules are as follows: Any live cell with fewer than two live neighbors dies. Any live cell with two or three live neighbors lives on to the next generation. Any live cell with more than three live neighbors dies. Any dead cell with exactly three live neighbors becomes a live cell. Live cells are to be represented with the character A (capital a), and dead cells are to be represented with the character . (a period). To begin, you will ask the user for the size of the game board (rows first, then columns). Next, prompt them for any cells they would like to be alive when the game begins. Finally, ask the user how many iterations of the game (number of time steps) they would like to see run. You should then display these iterations, showing each iteration separately. Hints and Advice It would be a good idea to: Store your board in a 2D list (make sure you dont mix up column and row!) Have a function called next iteration() that takes the current board in as a parameter, and that returns a new board with the next iteration Have a function called printBoard() that takes in the current board as a parameter and prints out the boards contents TIP: This would be a very good time to use incremental programming! Incremental development is when you are only working on a small piece of the code at a time, and testing that the piece of code works before moving on to the next piece. This makes it a lot easier to fix any mistakes. CMSC 201 Computer Science I for Majors Page 6 Project The project is worth a total of 80 points. Of those points 10 will be based on your design document, 10 will be based on following the coding standards, and the other 60 will be based on the functionality and completeness of your project. Design Document The design document will ensure that you begin seriously thinking about your project early on. This will not only give you important experience doing design work, but will help you gauge the number of hours you'll need to set aside to be able to complete the project. Your design document must be called design2.txt. For Project 2, you are creating the design entirely on your own. You may NOT work with another student to brainstorm a solution or discuss any general approaches or requirements. If you need assistance with the design document, come to office hours. Your design document must have four separate parts: 1. A file header, similar to those for your assignments 2. Constants a. A list of all the constants your program will need, including a short comment describing what each group of constants is for (e.g., menu options, meaning of indexes, etc.) 3. Function headers a. A complete function header comment for each function you plan to create, including the name, description, inputs, and outputs 4. Pseudocode for main() a. A brief but descriptive breakdown of the steps your main() function will take to completely solve the problem; note function calls under the relevant comment (if applicable) Your design can follow the same general format as the design for Project 1. CMSC 201 Computer Science I for Majors Page 7 Your design2.txt file will be compared to the proj2.py file that you submit. Minor changes to the design are allowed. A minor change might be the addition of another function, or a small change to main(). Major changes between the design and your project will lose you points. This would indicate that you didn't give sufficient thought to your design. (If your submitted design doesnt work, it is generally better to lose the points on the design, and to have a functional program, rather than turning into a broken program that follows the design. The decision is ultimately up to you.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!