[Tutor] Variation in game of life in python solution by numpy method

Mahesh Dabhade maheshdabhade05 at gmail.com
Mon Jan 25 12:53:52 EST 2016


Hi...I have problem in game of life...
But I have 4 states rather than just two states like live and dead...
These are
0 : bare earth
1: grass 2: prey 3: predator
And rules are
1 )if 2 surrounded by less than 2 of 1 then 2 becomes 1.....starvation
2)if 0 surrounded by more than 0 of 1 then 0 becomes 1
3)if 1 surrounded by more than 1 of 2 then 1 will be 0
4)if 3 surrounded by less than 2 of 1 then  3 becomes 0
Now I am not even able to count the neighbors....
Can u plzz help me out in counting neighbours...
N even better can u plzz send the program code....
It will be great help....
Thanks


More information about the Tutor mailing list