Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def range(from: Int, to: Int) = {
- def iter(cur: Int, acc: List[Int]) =
- if (cur == to) acc
- else iter(cur + 1, cur :: acc)
- iter(from, List[])
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement