Skip to content

Instantly share code, notes, and snippets.

@bijancn
Created May 30, 2018 08:52
Show Gist options
  • Save bijancn/a387cbdd838c35a04cb1b7be55710df7 to your computer and use it in GitHub Desktop.
Save bijancn/a387cbdd838c35a04cb1b7be55710df7 to your computer and use it in GitHub Desktop.
Don't do this at home
def addThree(list: List[Int]): List[Int] = {
var i = 0
var result = new ListBuffer[Int]()
while (i < list.length) {
result += list(i) + 3
i += 1
}
result.toList
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment