Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save masahitojp/c960ebad1d173c6341c2c783e17d0fb8 to your computer and use it in GitHub Desktop.

Select an option

Save masahitojp/c960ebad1d173c6341c2c783e17d0fb8 to your computer and use it in GitHub Desktop.
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