Skip to content

Instantly share code, notes, and snippets.

/.rb

Created September 20, 2015 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/bf49d9f7c974eccc7fb1 to your computer and use it in GitHub Desktop.
Save anonymous/bf49d9f7c974eccc7fb1 to your computer and use it in GitHub Desktop.
maze.size.times do |i|
if maze.cells[i].x >=1 && maze.cells[i].x < (maze.size - 2) && maze.cells[i].y >=1 &&maze.cells[i].y < (maze.size - 2)
direc = maze.cells[i].openings
if direc.include?("u") && direc.include?("d")
bridges += 1
end
if direc.include?("l") && direc.include?("r")
bridges += 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment