Hello folks,

I am trying since yesterday to make a game of life implemenation work. It
looks all ok so far but in can`t figure out the final steps. I think I get
the logic I have to use and if I imagine the code in C++ for example it
would be pretty much straight forward. But with pharo I got trouble telling
the machine what I want.

In short I`m trying to make this method work:



I wrote a test wich looks like this:



I want to go trough each element of the matrix(cells), check its surounding
cells if they are alive, and set its counter if there are any living
neighbours. It should move like this through the whole matrix to set the
neighbour counter for each element. 

In this method i just tried the implement the topLeft check yet but I think
you get the idea. You can look at the comment  in the top section it shows
where the neighbour indexes are.

I tried so many things by now, did research read methods of the superclasses
but I can`t make it work.
I woud be really glad if someone gave me a little hint. What is wrong here?



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply via email to