Implement game of life algorithm