cellular autonoma "edge effects"
Alrighty, I've built a simple ascii model of a cellular autonoma:
as you can see, each element checks to see if either the one above it or the one below is has a value of 1. if either one does, it is assigned the value of 1.
if( ((cells[a-1][b-1])==1) || ((cells[a-1][b+1])==1) ) cells[a][b]=1;
if(cells[a][b]) cout << (char)31;
else cout << (char)0;
cout << endl;
when it gets to the edge, for some reason the edge elements are assigned values of 1, even though no element above them is true.
the edge ones check for elements that technically don't exist, but those nonexistant elements should still be false...
if i change it to this it works:
thanks a lot for the help