Difference: Lab7Kenyon (4 vs. 5)

Revision 52015-10-27 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 7

Changed:
<
<

Due: Oct 30, 11:55pm

>
>

Due: Nov 3, 11:55pm

 

Instructions

  • Turn in the code (a cpp file or ideone.com link), and the run outputs as requested below.
Line: 91 to 91
 

Design - the following routines might be useful:

  • int alive(char cell) - return a 1 for life ('*'), and 0 otherwise. Use to check if a cell is alive.
Changed:
<
<
  • char nextGenCell(int x, int y) - return a '*' is the cell at this location should be alive in the next generation. Otherwise return a space.
>
>
  • char nextGenCell(int x, int y) - return a '*' if the cell at this location should be alive in the next generation. Otherwise return a space.
 
  • void nextGenWorld(char current[ ][80], char next[ ][80]) - Given the current world, compute the next generation for the world.
Changed:
<
<
  • void copyWorld(char from[ ][80], char to[ ][80]) - Copy world from to world to.
>
>
  • void copyWorld( char from[ ][80], char to[ ][80]) - Copy world from to world to.
 You find a LOT of interesting patterns here: conwaylife

There is a cool online version to play with here

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback