apply rule in gameoflife