File: parse-error.mlr

package info (click to toggle)
miller 6.16.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 87,928 kB
  • sloc: ruby: 162; sh: 119; makefile: 87
file content (21 lines) | stat: -rw-r--r-- 290 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

begin {
  @f["0"] = 1;
  @f["1"] = 1;
}
func f(n) {
  str sn = string(n);
  if (is_absent(@f[sn])) {
    num fn = f(n-1) + f(n-2);
    f[sn] = fn;
    return fn;
  } else {
    return @f[sn]
  }
}
end {
  for (n = 1; n < 100; n += 1) {
    print string(n) . " " . string(f(n))
  }
  x x
}