Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def updown(n)
- puts "#{updown2(n,0)}"
- end
- def updown2(n,i)
- if n == i
- return "#{n}, "
- elsif i == 0
- return "0, #{updown2(n,i+1)}, 0"
- else
- return "#{i}, #{updown2(n,i+1)} , #{i},"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement