int main(void) {
char arr[] = "%d\n%d\nfizz\n%d\nbuzz\nfizz\n%d\n%d\nfizz\nbuzz\n%d\nfizz\n%d\n%d\nfizzbuzz\n";
int news[]={0,3,6,11,14,19,24,27,30,35,40,43,48,51,54,63};
int i=N/15, j=1;
>>4
I believe fizzbuzz is supposed to work with 1-n. but it could be easily modified for any interval will not work properly if n is not a multiple of 15
it does
>>2
We already had many Fizzbuzz threads, I'm not going to point you to them. The reason I said "Nope" is because anyone who understands basic CS knows that Kolmogorov complexity of a string (such as the final FizzBuzz output) is uncomputable, although I suppose one can get good approximations for specific machines if they're willing to do a lot of specific mathematical proofs (usually mechanized). In a bit more general terms, no perfect optimizing compiler can exists as well: http://en.wikipedia.org/wiki/Full_employment_theorem
No more than an universal halting problem solver (although specific-case can be done, and possibly self-improving as well, although it's provable that there will always be programs you won't be able to decide, just like there will always be arithmetical truths that won't be reachable by proofs, by Godel's incompleteness theorem).
Previous post was meant to be directed at >>3, not at >>2.
Name:
Anonymous2012-01-29 14:48
>>6
the set of terminating programs is recursively enumerable, and fizzbuzz clearly terminates
Name:
Anonymous2012-01-29 15:15
>>8
Sure, let's restrict ourselves to that set, it would make things easier. I'll give you the honor of constructing the set since it was your idea. Shouldn't be too hard, just use Jot1 to enumerate all programs and select the terminating ones among them. Jot is handy for this task, if you used binary-coded Jot, the new Gödel numbering is the code.
Once you've constructed the set I'll do the analysis to find the most efficient one.
>>14
actually, that #include <stdio.h> is unnecessary, unless you want to replace write (POSIX) with fwrite (standard C, almost always implemented using write).