Created
April 8, 2015 04:16
-
-
Save anonymous/6c50d51afd421ddad8a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minesarray = [['*','.','.','.'],['.','.','*','.'],['.','.','.','.']] | |
def pp_board(board) | |
puts Array.new(board[0].size*2+1, '-').join('') | |
board.each do |row| | |
puts "|" + row.join("|") + "|" | |
puts Array.new(row.size*2+1, '-').join('') | |
end | |
end | |
pp_board(minesarray) | |
count = 0 | |
minesarray.each do |i| | |
i.each do |j| | |
for j in i | |
if j != '*' | |
j = 0 | |
end | |
end | |
end | |
end | |
puts minesarray |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment