Created
October 4, 2012 21:02
-
-
Save colemanfoley/3836436 to your computer and use it in GitHub Desktop.
Print grid method
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
def print_grid(x = 5, y =5) | |
row_0 = "00000" | |
row_1 = "00000" | |
row_2 = "00000" | |
row_3 = "00000" | |
row_4 = "00000" | |
if y == 0 | |
row_0[x] = "X" | |
elsif y== 1 | |
row_1[x] = "X" | |
elsif y== 2 | |
row_2[x] = "X" | |
elsif y== 3 | |
row_3[x] = "X" | |
elsif y== 4 | |
row_4[x] = "X" | |
end | |
puts row_0 | |
puts row_1 | |
puts row_2 | |
puts row_3 | |
puts row_4 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment