Skip to content

Instantly share code, notes, and snippets.

@colemanfoley
Created October 4, 2012 21:02
Show Gist options
  • Save colemanfoley/3836436 to your computer and use it in GitHub Desktop.
Save colemanfoley/3836436 to your computer and use it in GitHub Desktop.
Print grid method
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