File: filt_fibo

package info (click to toggle)
saml 970418-9
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,188 kB
  • ctags: 1,703
  • sloc: ansic: 17,186; sh: 2,573; yacc: 497; perl: 264; makefile: 242; python: 242
file content (7 lines) | stat: -rwxr-xr-x 192 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
#!/bin/sh
perl -ne '$|=1; chop; print "fibo[$_]\n";' | induce -q -m- -e \
'precious fibo(1);
 fibo[0]=0; fibo[1]=1;
 fibo[n]=fibo[n-1]+fibo[n-2] if n>1;
 fibo[n]=fibo[n+2]-fibo[n+1] if n<0;
'