• Create Account

### #Actualboogyman19946

Posted 10 January 2014 - 10:30 PM

Nobody said we had to use a real language. Therefore, zero characters, using the newly created "bottles of beer" language..




The specification of the "bottles of beer" language states that:

An empty source file shall produce a program which prints out the lyrics of the "99 bottles of beer" song. The behaviour of non-empty source files is unspecified.

Thank you.

Someone has already kinda-sorta beat you to the punch

I'm not sure if anyone has mentioned this in the thread, but... introducing HQ9+

9


99 Bottles of Beer in 1 character.

EDIT: Ehh, what the heck, I thought I'd join the fun. My weapon of choice is C:

#define z(s,t) h(s,t," bottle%s of beer"," on the wall",i:,"o more",i==1?"":"s")
#define h(a,q,b,c,d,e,f) printf(a b c", "a b".\n%s, "q b c".\n\n",i?d"N"e,f,i!=0?d"n"e,f,i?"Take one down and pass it around":"Go to the store and buy some more",i==0?99:i!=1?i-1:"n"e,i==2?"":"s")
main(){int i=99;for(;i>=0;i--)i==0?z("%s","%i"):i==1?z("%i","%s"):z("%i","%i");}


Also, I got it on codepad to show that it in fact executes correctly: http://codepad.org/CIeL7PZm

It is 358 characters I think. I compiled it using GCC with both -std=99 and -std=89 and the results are the same. It compiles with many warnings but it runs nonetheless.

Fun fact, I ran GCC -E when I was testing the macros for correctness, and they expand to over 1000 characters of code XD

### #1boogyman19946

Posted 10 January 2014 - 12:47 AM

Nobody said we had to use a real language. Therefore, zero characters, using the newly created "bottles of beer" language..




The specification of the "bottles of beer" language states that:

An empty source file shall produce a program which prints out the lyrics of the "99 bottles of beer" song. The behaviour of non-empty source files is unspecified.

Thank you.

Someone has already kinda-sorta beat you to the punch

I'm not sure if anyone has mentioned this in the thread, but... introducing HQ9+

9


99 Bottles of Beer in 1 character.

PARTNERS