class Pascal { method pascal(i : Int; j : Int) : Int = if (i == 1) || (j == 1) || (i == j) then 1 else this.pascal(i - 1; j - 1) + this.pascal(i - 1; j) method triangle0(n : Int; i : Int; j : Int) : Int = { printInt(this.pascal(i; j)); if i == j then 0 else printChar(32) return if n == i then if i == j then true else this.triangle0(n; i; j + 1) else if i == j then { printChar(10) return this.triangle0(n; i + 1; 1) } else this.triangle0(n; i; j + 1) } method triangle(n : Int) : Int = this.triangle0(n ; 1 ; 1) } new Pascal.triangle(10)