Last active
December 16, 2015 06:09
-
-
Save mapfel/5389664 to your computer and use it in GitHub Desktop.
Ruby - day 2: paging array content in slices of four
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
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