This file contains 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
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) | |
} |