Skip to content

Instantly share code, notes, and snippets.

@carlism
Created September 28, 2012 16:24
Show Gist options
  • Save carlism/3800774 to your computer and use it in GitHub Desktop.
Save carlism/3800774 to your computer and use it in GitHub Desktop.
Game Of Life Neighborhood
def neighborhood
n = []
[-1,0,1].each {|y_adj|
[-1,0,1].each {|x_adj|
n << [@x + x_adj, @y + y_adj]
}
}
n.delete_at(4)
n
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment