Files
Cody Boone Ferguson 56a0711630 2001/anonymous updates
Format fix in README.md.

Add cpp.c which is the C pre-processed version cleaned up and somewhat
commented as it heavily (ab)uses the ternary operator and recursion.
Probably futile but it gave me something to do even if it was a waste of
time (could have worked on other README.md files or a host of other
things). This did indeed take a long time and a lot of effort!

Updated bugs.md with more hints about this entry. I explained here how I
came up with the C pre-processed version as it involves something of a
hack because of the complicated build instructions.

Updated anonymous.ten.c: #include <stdio.h>

Added anonymous.ten rule to Makefile.

Also disabled optimising level as the author stated that this makes it
slower.

I observed that the author is anonymous and yet the author information
shows the country. I'm not sure if this is intended or not.
2023-04-21 05:46:10 -07:00

21 lines
405 B
C

#include <stdio.h>
#define PLURAL(bottles) bottles==1?"bottle":"bottles"
void sing(int bottles) {
printf("%d green %s, standing on the wall.\n", bottles, PLURAL(bottles));
}
int main() {
int bottles = 10;
while(bottles) {
sing(bottles);
sing(bottles);
printf("And if one green bottle should accidentally fall,\nThere'd be ");
sing(--bottles);
printf("\n");
}
return 0;
}