0
Can you help me with the bug in this simulation ?
I was making a c# simulation on conway's game of life. I make it working but i than checked with some other simulators out there, and it don't give the same results..? My simulation is based in a wrap around world. You can change the grid (cols, rows). Please help me out! Thankyou..! https://code.sololearn.com/cN5pbfrAM0UV/?ref=app
2 ответов
+ 1
In conways game of life you check each piece for its neighbours. In you movement loop your code iterates at for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
but then you should not use the value i=0 && j=0 for this is the element itself.
0
But then i subtract the value of itself just after that loop..?