Am 26.11.2010 20:41, schrieb Tony Firshman:
P Witte wrote, on 26/Nov/10 19:34 | Nov26:
Marcel Kilgus wrote:
Tony Firshman wrote:
I obeyed the rules (8-)#

Maybe, but that is more creativity in applying the rules than
creativity in programming. You clearly have chosen the wrong career,
you should have been a lawyer ;)

... and there is nothing to say the program has to be run more than
once.
I did considering initialising and it would still have been under 89.

And yet I still don't think your entry is valid ;-)

Otherwise my new entry is this:
1a

a is machine code function loaded beforehand that prints out the
values 1 to 100 on screen and writes FIZZ if the value is divisible by
3 and BUZZ if the value is divisible by 5. Surely the rules didn't say
anything about only using inbuilt commands ;-)

I bet theres a built-in command in perl called FUZZBUZZ (with 1a as a
common ailias) I knew it would get down to semantics in the end. But I
agree: Tony's cheating ;o)

Anyway, just for the sake of a tidy reputation: I found some more
unnecessary fat to trim:

1defproc z:if i mod 3=0:print'FIZZ';:endif:if i mod
5=0:print'BUZZ';:endif:print:enddef:for i=1to 100:print i,:z

113b

Ok, if fancy formatting is not a requirement then Im raising your 91 to:

1for i=1to 100:print i,:if i mod 3=0:print'FIZZ';:endif:if i mod
5=0:print'BUZZ'

81b !

I don't agree I cheated - I obeyed the rules (8-)#

In your program there is no line break if no BUZZ.

What a pity SB does not have .= operator.

Tony

Hi,
this all reminds me very much of the "obfuscated C" competition:
http://www.de.ioccc.org/main.html

There an entry would look like

main(){for(;;i++){puts(!i%3)?"FIZZ":(!(i%5)?"BUZZ":""));}}

59 bytes....
but expands to 13856 when fed through C68 (But is wayyyy faster than any of your old SBASIC stuff ;-) )

And is of course way more readable, structured, object-oriented and modern as well.....

Cheers,
Tobias



_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to