99 bottles of beer: Difference between revisions
Content added Content deleted
(→{{header|UNIX Shell}}: Tweak Bourne Shell to output complete verses. Add C Shell.) |
|||
Line 516: | Line 516: | ||
An inspection of the generated executable proves that it indeed contains the complete text of the song in one block. |
An inspection of the generated executable proves that it indeed contains the complete text of the song in one block. |
||
===The bottled version=== |
|||
WYSIWYG (with correct plurals and can buy some more):<lang c> int b= 99,u=1; |
|||
#include<stdio.h> |
|||
char * d[ 16 ]; |
|||
char y[]= "#:o" |
|||
"ttle/ of:eer" |
|||
"_ a_Go<o5st>" |
|||
"y\x20some6_T" |
|||
"ake8;down4pa" |
|||
"=1rou7_17 _<" |
|||
"h;_ m?_nd_ o" |
|||
"n_085wall_ b" |
|||
"_e _ t_ss it" |
|||
"_?4bu_ore_9," |
|||
" \060.@, 9$"; |
|||
# define xor ^= |
|||
#include<string.h> |
|||
#define or(x,z) else\ |
|||
if(c==x/*smokescreen*/\ |
|||
&& !(c = 0) && (c =! z)); |
|||
int p(char*x){char *s = x \ |
|||
; unsigned char c; for ( d[ |
|||
c = 0]=y; ! x && (d[c + 1]= |
|||
strchr( s = d[c], '_')); *( |
|||
d[++c]++)= 0); for (x = s?: |
|||
x; (c = *s++); c?putchar(c) |
|||
:0) {if (! (((c xor 48) & ~ |
|||
0xf) && (c xor 48 ))) p( d[ |
|||
c ]), c = 0; or ('$', p (b- |
|||
99 ? ".\n":".") && p (b- 99 |
|||
? x : "")) or( '\x40', c && |
|||
p(d[!!b--+2])) or('/', c && |
|||
p (b ^1 ? "s" : "")) or( '\ |
|||
\043', b++ ? p("So6"+--b) : |
|||
! printf ( "%d" , b? -- b : |
|||
(b += 99 ) ) ) or ('S', !( |
|||
++u % 3 ) * 32 + 78) or('.' |
|||
,puts("" ".")) } return c;} |
|||
int main() {return p(0);}</lang> |
|||
=={{header|C++}}== |
=={{header|C++}}== |