Skip to content

Instantly share code, notes, and snippets.

@joelibaceta
Last active October 5, 2015 03:15
Show Gist options
  • Save joelibaceta/079f57bb9d9767623bb1 to your computer and use it in GitHub Desktop.
Save joelibaceta/079f57bb9d9767623bb1 to your computer and use it in GitHub Desktop.
def square(n, ext_char, int_char)
(0..n).map{|i| p (0..n).map{|j| ([0, n].to_a & [i, j]).any? ? ext_char : int_char }.join}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment