Re: Fibonacci program
- From: "Judson McClendon" <judmc@xxxxxxxxxxxxx>
- Date: Mon, 24 Oct 2005 10:42:54 -0500
And here I was, spouting off about no International Obfuscated COBOL
Contest! We should simply declare Mike B the winner now. :-)
--
Judson McClendon judmc@xxxxxxxxxxxxx (remove zero)
Sun Valley Systems http://sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."
"Mike B" <mxbNoSpam@xxxxxxx> wrote:
>
> My bad, it came across wrong. Here is a correct copy of the program. Don't
> forget the continuation signs in column 7.
>
> FILE SECTION.
> WORKING-STORAGE SECTION.
> 01 valueList.
> 05 fil1er pic 999(3)9999 value zero. 05 fi1ler pic 999(3)999.
> 05 filler1 pic 9. 05 fil1erl pic x(26) value ' seires iccabn
> - 'ettirw toN'. 05 fi1ler1 pic 9(9) value zero. 05 fil1er1 pic
> 9(8). 05 fillerl pic 9. 05 fi1lerl pic x(26) value '
> - ' '. 05 fil11erl pic 9(9) value 1. 05
> fi11erl pic 9(8). 05 filler11 pic 9. 05 fi11erll pic x(26)
> value ' em ynnobiF fo dnE'.
> 01 filler redefines valuelist. 05 array occurs 3. 10 fi1ler1l
> pic 9(9). 10 fil1erl1 pic 9(8). 10 fi11er1l pic 9. 10 fi1
> - 1erl1 pic x(13). 10 fillerll pic x(13).
> 01 filler. 05 loop pic 9. 05 fibonacci pic 9(9).
> Linkage section.
> Procedure division. Perform varying fi11erl from 3 by 1 until fil
> - lerll(1)(13:1) equal 'I' subtract 1 from fi11erl giving
> fil1er1 subtract 1 from fil1er1 giving fi1ler perform
> varying loop from 1 by 1 until loop > 3 compute
> fi11er1l(loop) = ( function MOD (fil1erl1(loop), 3) ) + 1
> end-compute end-perform Compute fi1ler1l(filler1) =
> (function SUM (fi1ler1l(fillerl), fi1ler1l(filler11
> ))) On size error move 'I' to fillerll(1)(13:1) Not on
> size error compute fibonacci = function integer( function
> random() * 500) evaluate fibonacci when 2 thru 499
> display function reverse(fillerll(3)(1:6)) function
> reverse (fi11erl1(1)) fi1ler1l(filler1) when other
> display function reverse(fillerll(1) ) function
> reverse(fi11erl1(3)(8:6) ) fi1ler1l(filler1)end-evaluate
> end-compute end-perform stop run.
.
- References:
- Fibonacci program
- From: spartacus
- Re: Fibonacci program
- From: Mike B
- Re: Fibonacci program
- From: Mike B
- Fibonacci program
- Prev by Date: Re: Fibonacci program
- Next by Date: Re: Fibonacci program
- Previous by thread: Re: Fibonacci program
- Next by thread: Re: Fibonacci program
- Index(es):
Relevant Pages
|
|