Boss

Boss: Life on the Island

The boss
Boss Fight!
Every passing test breaks a shield.

The Isle of Embers is covered in glowmoss, which spreads by the Game of Life rules. The Stone Golem guards the island. It will only let the Guild pass if you can show it the moss's future, twelve generations ahead.

The Guild's map marks moss with #. A glider sits in the top-left corner (a shape that crawls diagonally!) and a blinker in the top-right.

neighbors and next_generation from your earlier quests are ready to use.

Assignment

  1. parse(rows) turns a list of strings into a grid: 1 for "#", 0 for any other character.
  2. run_life(grid, generations) returns a list of generations + 1 grids: the starting grid, then each next generation. Don't change grid.
  3. draw_cells(canvas, grid, alive, dead) paints every cell: colour alive for 1, colour dead for 0.
  4. Finish the program: for every grid in history, draw it with "grass" and "night" and show() it (13 frames).
  5. Finally print Glowmoss after 12 generations: N, where N is the number of live cells in the last grid.