Answer to Akitabox's code challenge #1
This exercise uses nodejs 8 to run locally. Input is assumed to be correctly formatted plain text file similar to the input presented in the coding exercise pdf. Rows are delimited by newlines (\n) and elements in columns are one character long entries that can take the value of 0 or 1. Reference test_input.txt.
To run the program, use:
node main.js <file>
The main flow of the program follows:
- Parse the inputted board file
- Create a copy of the board
- For every cell in the old board
- Count the amount neighbors that cell has
- Update the corresponding new board's cell as dead or alive
- Format and output the new board