Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [23] pry(main)> x = [1,2,3,4,5,6,7]
- => [1, 2, 3, 4, 5, 6, 7]
- [24] pry(main)> while(not x.empty?)
- [24] pry(main)* puts "#{x[0]} -- #{_[1]||"(null)"}"
- [24] pry(main)* x.shift
- [24] pry(main)* end
- 1 -- 2
- 2 -- 3
- 3 -- 4
- 4 -- 5
- 5 -- 6
- 6 -- 7
- 7 -- (null)
- => nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement