File: recursiontest.cfdg

package info (click to toggle)
contextfree 3.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,432 kB
  • sloc: cpp: 34,857; lex: 416; makefile: 124; sh: 42; python: 41
file content (25 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
startshape test2

CF::MaxNatural = 10

natural fib(natural n) = if(n <= 1, n, fib(n -- 1) + fib(n -- 2))

ack(m, n) = if(m == 0, n+1, if(n == 0, ack(m-1, 1), ack(m-1, ack(m, n-1))))

foo = ack(1,1)

erf(n) = if(n > 0, 1, -1) *
sqrt(1 - exp(-n * n * (4 / 3.1415926535 + 0.147 * n * n) / (1 + 0.147 * n * n)))

shape test {
  loop i = 1, 10 [x 1]
    SQUARE [[y 0.5 s 1 fib(i) y 0.5]]
}

shape test2 {
  loop m = 4 [y 1] {
    loop n = 6 [x 1]
      SQUARE [sat 1 b 1 h ack(m,n)]
  }
}