// // factorial function // def factorial(n : Int) : Int = { if (n > 1) n * factorial(n-1) else 1 }