Re: Fibonacci program



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.


.



Relevant Pages

  • Bad Writing Contest Winner
    ... of the 23rd running of the Bulwer-Lytton Fiction Contest. ... Runner-Up: ... Winner: Adventure Category ...
    (misc.news.internet.discuss)
  • Ants
    ... different languages the "non-bashing-way" (winner gets "unlimited bragging ... This year I heard of this contest for the first time, ... clearly defines the possible states of the "ant-brain", the simulator, the ... Everyone who wants to make good ants has to write a fast, ...
    (microsoft.public.vb.general.discussion)
  • Re: memories...of MIS "contests" past...
    ... You are a loser. ... You just whine like the little boy I ... 2007 GUESS THE DOW CONTEST ... He's not just a contest winner, like "JBoatFake", he's a contest ...
    (misc.invest.stocks)
  • It was a dark and stormy night...
    ... winner of the 23rd running of the Bulwer-Lytton Fiction Contest. ... An international literary parody contest, ... Winner: Purple Prose ... Bradshaw shot him." ...
    (misc.writing)
  • Re: OMG... True story
    ... contest and hurts ticket sales! ... show like the Olympia regardless of the placings. ... The contest is the thing for me. ... So you believe, on some level, that the winner was based on financial ...
    (misc.fitness.weights)