Conway's Game of Life ===================== .. toctree:: :maxdepth: 1 Indices and tables ------------------ * :ref:`genindex` * :ref:`modindex` * :ref:`search` Background ---------- Not actually a game, Conway's Game of Life is a cycle-based simulation of the evolution of cells based on a initial condition (the initial cell population) and some simple rules that determine whether each cell lives or dies on each cycle. Wikipedia provides a a good `overview `_ along with the cycle-to-cycle rules and some ideas for initial populations. Exercise -------- Implement Conway's Game of Life using Python. The initial population is up to you. The screen should NOT scroll, but, rather fully refresh on each cycle. Hints ----- * The terminal has crazy functionality most people are not aware of. It is exposed via escape codes, which you can read about `here `_. Keep in mind, Jupyter is NOT a terminal, and you won't be able to get it to NOT print a new line for each cycle of the progress bar. Use PyCharm or the interpreter instead. * Checkout the :py:mod:`time` module for methods to pause execution temporarily. * If you are not already familiar with using PyCharm to run and debug source code, this is a great project to learn how to do it. There WILL be many situations where you will want to interrogate the value of your internal objects and PyCharm is much more powerful at this than literring your code with :py:func:`print` statements. Solution -------- When you are ready to see one possible solution, try :download:`this file ` .. _CGOL: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life .. _wikipedia_escape_codes : https://en.wikipedia.org/wiki/ANSI_escape_code