Skip to content

Instantly share code, notes, and snippets.

@ahpook
Created July 5, 2011 04:23
Show Gist options
  • Select an option

  • Save ahpook/1064247 to your computer and use it in GitHub Desktop.

Select an option

Save ahpook/1064247 to your computer and use it in GitHub Desktop.
Pair programming with my 6-year-old
#!/usr/bin/ruby
# times-tables.rb by gunnar and eric sorenson
x = 12
y = 12
puts "-" + "----" * x
1.upto(y) do |i|
print "|"
1.upto(x) do |j|
printf("%03s|", i * j)
end
print "\n"
end
puts "-" + "----" * x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment