Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # How to make this more legible?
- # n and m are any natural number
- n=1; m=12
- (n..m).map{ |i| ["%02d"%i,i] }
- #=> [["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9], ["10", 10], ["11", 11], ["12", 12]]
Add Comment
Please, Sign In to add comment