Speaking of me, you ( ChrisV ) wrote: > The Relf kook once described some of his unreadable garbage > as "the finest code you'll ever see". As near as I can tell, I'm the best c coder here. I don't recall your Fizz Buzz code, by the way. http://Jeff-Relf.Me/FizBuz.HTM I reduced Owls 43 lines, 74 columns to 5 lines, 71 columns: char *Say[16] = { "%d", "Fiz", "Buz", "FizBuz", "Goz", "FizGoz", "BuzGoz", "FizBuzGoz", "Kaz", "FizKaz", "BuzKaz", "FizBuzKaz", "GozKaz", "FizGozKaz", "BuzGozKaz", "FizBuzGozKaz" }; int x = 0 ; while ( x++ < 100 ) printf(", "), printf( Say[ 8*!(x%11) + 4*!(x%7) + 2*!(x%5) + !(x%3) ], x ); Output: 86, Fiz, Kaz, 89, FizBuz, Goz, 92, Fiz, 94, Buz, Fiz, 97, Goz Fabian and Owl never realized that I/O was the bottleneck.
You ( Michael Glasser ) replied: > > http://Jeff-Relf.Me/FizBuz.HTM > > I reduced Owl's 43 lines, 74 columns to 5 lines, 71 columns: > > > > char *Say[16] = { "%d", "Fiz", "Buz", "FizBuz", "Goz", "FizGoz", > > "BuzGoz", "FizBuzGoz", "Kaz", "FizKaz", "BuzKaz", "FizBuzKaz", > > "GozKaz", "FizGozKaz", "BuzGozKaz", "FizBuzGozKaz" }; int x = 0 ; > > while ( x++ < 100 ) printf(", "), > > printf( Say[ 8*!(x%11) + 4*!(x%7) + 2*!(x%5) + !(x%3) ], x ); > > A count of lines is hardly a good sign of quality. My version had a higher SignalToNoise ratio, compared to Owl's. You, on the other hand, are THE UNDISPUTED KING of low SignalToNoise ratios. Your "From:" line says it all: In a "Snit", you flood us with "Galloping Insanity". From 9/8 to 9/11 last year, 2016, you posted 589 times in 4 days. That's almost 150 per day, for 4 straight days, leading up to 9/11. "insane", "Galloping", in a "Snit".
Speaking of "Jeff-Relf.Me/FizBuz.HTM", you ( Michael Glasser ) wrote: > "smaller is better" or "fewer lines is better" seems absurd to me. SignalToNoise matters, many YouTube tutorials mention it. Comments can make code LESS readable, for example. > > My code is easier to read (hold on Jeff) in the sense that even a > > beginner can read and understand it just by looking at it. > > But it won't scale. Jeff's code is smarter. > > [...] > > Jeff, your solution is the best I've seen, in my humble opinion. > > I certainly have no issue with it and it blows away what I offered > ( as does, well, pretty much every other example posted here ). I enjoyed what FizzBuzz told me about others here; what others think of me is far less interesting. My "FizBuzGozKaz" array of strings is harder to grasp; but, if simplicity were the only standard, comics would rule. Marek Novotny wrote in the style I see on YouTube, -- he did better than Owl, Fabian or Snit; but, because he'd use bash, not C, I think that makes me more of a C programmer than him.
Speaking of "Jeff-Relf.Me/FizBuz.HTM", you ( Steve Carroll ) told me: > there are too many places you may have seen the example you put up > ( or something similar ) and then reproduced it while not even being > aware that's what you did. Here's 6 versions of it, in C, including mine: https://rosettacode.org/wiki/FizzBuzz#C One is similar to mine ( except I do 4 primes too ); I hadn't seen it before now. One C# version took 121 lines, 125 columns; One C++ version took 165 lines, 285 columns; mine is 2 lines, 71 columns, indented. I don't see any implementations, in any language, smaller than mine. > you need something that goes far more in depth > than fizz buzz to assess who is 'the best' at any given language. FizzBuzz is a FANTASTIC way to see who has what skills; anything more complex would obscure the issue.
The following was inspired by the lowest SignalToNoise,
EasiestToModify solution; to wit, (JavaScript):
for(i=0;i<100;console.log((++i%3?"":"Fizz")+(i%5?"":"Buzz")||i));
With 2 prime numbers, the C code is:
int i = 0 ; char B[88] ;
while ( i++ < 100 )
!sprintf( B, "%s%s", i%3 ? "":"Fizz", i%5 ? "":"Buzz" )
? sprintf( B, "%d", i ):0, printf( ", %s", B );
With 4 prime numbers:
int i = 0 ; char B[88] ;
while ( i++ < 100 )
!sprintf( B, "%s%s%s%s",
i%3 ? "":"Fiz", i%5 ? "":"Buz", i%7 ? "":"Goz", i%11 ? "":"Kaz" )
? sprintf( B, "%d", i ):0, printf( ", %s", B );
Output:
..., 89, FizBuz, Goz, 92, Fiz, 94, Buz, Fiz, 97, Goz, FizKaz, Buz