Skip to content

Instantly share code, notes, and snippets.

object Euler002 extends App {
def addFib(num1:Int, num2:Int, result:Int) : Int = {
var sum = result
if(num2%2 == 0) sum += num2
var newNum = num1+num2
if(newNum > 4000000) return sum
else return addFib(num2, newNum, sum)
}