rev: 3827f53bae88e48a594610914ba74b9512ead6dd tukan/testing/test_math.sc -rw-r--r-- 327 bytes View raw Log this file
3827f53bae88 — Leonard Ritter * more work on module system 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using import ..tukan.math

print (pascal-triangle 7)

let k = (pascal-triangle 7)
assert (k == 35)

for n in (range 8)
    for k in (range (n + 1))
        io-write!
            repr (pascal-triangle n k)
        io-write! " "
    io-write! "\n"

assert ((pascal-triangle 7 3) == 35)
assert (constant? (pascal-triangle 7 3))