Pascal's triangle: Difference between revisions

Line 785:
Simple recursive row definition:
<lang scala>
def tri(rowsrow:Int):List[Int] = { rowsrow match {
case 1 => List(1)
case n:Int => List(1) ::: ((tri(n-1) zip tri(n-1).tail) map {case (a,b) => a+b}) ::: List(1)