Project #20907 - C++ Assignment, need to be able to compile in UNIX/LINUX Server

All the details are attached.

Needs to compile in UNIX/Linux servers.

You are to ONLY modify the life.cpp file.

 

 

Professor Notes:

Here is how to use the input0, correct0 files to test your solution to the Life project. Assuming your program has compiled to executable named  main, do the following from the circe command line.

$./main < input0 > output0

$ cmp output0 correct0

If the prompt returns with no message the two files are the same.  If not, bring the two files up in an editor and visually compare them to see the difference.  One easy way is to use emacs or xemacs:

$ xemacs output0 correct0

The xemacs window will appear with both files visible in vertically stacked windows.  Now hit the escape key, then x.  The cursor will be in the little window at the bottom of the screen.  Enter compare-windows and hit return.  The cursor will move in both windows to the first point where the files differ.  If you move the cursors in both files to a position past the original difference (same position in both files) and repeat the esc x compare-windows command, the cursor will move to the next difference in the two files.

 

It is expected that input of the rules of life will consist of asking the user to enter the number of live neighbors that will cause a dead cell to become alive in the next generation, terminating input with a -1.  Then enter the neighbor counts that will cause a live cell to die in the next generation, again terminating input with -1.

Thus, input0 provides the following:

5 rows and 5 columns in the grid

A dead cell becomes alive if and only if its neighbor count is 3

A live cell dies if its neighbor count is one of 0, 1, 4, 5, 6, 7, 8

NOTE: these are the rules of our original version of Life.

The live cells in the initial configuration are

(1,2), (1,4), (2,1), (2,2), (2,4), (3,2), (3,3), (3,4) (4,1), (4,4), (4,5)
(5,2), (5,3) and (5,4)

Note: there was an extra (2,4) in the input, but it should cause no problems.

Finally, 5 generations will be printed after the initial configuration.

 

 

Subject Computer
Due By (Pacific Time) 01/17/2014 12:00 pm
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy