Fizzbuzz in SNOBOL4

Posted by Daniel Lyons Mon, 31 Dec 2007 18:06:00 GMT


**  FizzBuzz in SNOBOL4
**
**  Daniel Lyons <fusion@storytotell.org>
**
**  Yes, I am insane, before you ask.
**
**

        I = 1
LOOP    FIZZBUZZ = "" 
        EQ(REMDR(I, 3), 0)              :F(TRY_5)
        FIZZBUZZ = FIZZBUZZ "FIZZ" 
TRY_5   EQ(REMDR(I, 5), 0)              :F(DO_NUM)
        FIZZBUZZ = FIZZBUZZ "BUZZ"      
DO_NUM  IDENT(FIZZBUZZ, "")             :F(SHOW)
        FIZZBUZZ = I
SHOW    OUTPUT = FIZZBUZZ
        I = I + 1
        LE(I, 100)                      :S(LOOP)
END

Tags , ,  | 1 comment

Comments

  1. Avatar Andrew Hedges said about 5 hours later:

    Yes, but is it SNOBOL4ic? ;-)

(leave url/email »)

   Comment Markup Help Preview comment