
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Place your code for computing the next state of the cells in this script.
% Note the following *important* directives --- your code *will not* work
% unless you follow the guidelines listed below
%
% 1) Do *not* modify any of the other files in the package. Feel free to
% look around however!
% 
% 2) On this assignment, do *not* preface your script with `clear' or `clc'
% statements. You must, however, follow the other code standard guidelines.
%
% 3) The current state of the cells is available in two matrices,
% named blueCells and redCells. Refer to the assignment handout as to
% how the information is organized in them. Compute the next state of the
% cells and store them in variables named nextBlueCells and nextRedCells,
% following the same conventions.
%
% 4) Remember that there are no update rules for the cells that lie
% on the boundary of the board (since they do not have eight
% neighbors). Keep this in mind when determining the bounds of your loops. 
%
% Remove this header once you are done, and replace it with the standard
% submission header (one header with your name etc. + another header 
% describing what the script does).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% The following block of code is here to help you troubleshoot your
% code if it does not work right. To use it, uncomment the block of
% code and place it at the *end* of your script. Then, run the
% simulator by callng gameOfLife. When the simulator starts up, make
% sure Glider is selected as the starting pattern and click on
% 'Run'. The first five rows and columns of the matrices blueCells,
% nextBlueCells, redCells and nextRedCells will be printed to the
% Command window and the program will halt with an error message
% (ignore the message). Now, compare your computed nextBlueCells and
% nextRedCells matrices against those in the file debug.txt that came
% packaged in gameOfLife.zip. This should help you determine which of
% the rules is not being applied correctly.

% *** Once you have a working program, you can remove these comments ***
 
% disp('Blue Cells:');
% disp(blueCells(1:5, 1:5));
% disp(nextBlueCells(1:5,1:5));
% disp('Red Cells:');
% disp(redCells(1:5, 1:5));
% disp(nextRedCells(1:5, 1:5));
% error('Stopping now...');

