Skip to content

Instantly share code, notes, and snippets.

@mapfel
Last active December 16, 2015 06:09
Show Gist options
  • Save mapfel/5389664 to your computer and use it in GitHub Desktop.
Save mapfel/5389664 to your computer and use it in GitHub Desktop.
Ruby - day 2: paging array content in slices of four
a = (1..16).to_a
a.each {|i| i % 4 == 0 ? (puts i) : (print i, ", ")}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment