Created
May 17, 2016 10:13
-
-
Save masahitojp/c960ebad1d173c6341c2c783e17d0fb8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def range(a: Int,b: Int, l:List[Int] = List.empty[Int]):List[Int] = { | |
| if (a >= b) l.reverse | |
| else range((a+1), b, a ::l) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment