|
2 minutes, 49.91 seconds.
That includes opening Visual Studio, starting a test C# project, coding, and testing. Oh, and a quick walk across the keyboard from Dij The Cat which had to be corrected.
I could have done it faster, but I've just got out of bed and haven't even sipped my coffee yet - it's too hot.
If any developer can't actually do that in under ten minutes, they are in the wrong business - and possibly the wrong species ...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
That's a pretty cool library. That FizzBuzz solution is interesting but the statement that it doesn't use a single loop is misleading at best. Cycle() is implemented with a foreach nested inside a while .
|
|
|
|
|
Jon McKee wrote: Cycle() is implemented with a foreach nested inside a while .
What you try to get away with:
void Foo()
{
LookMa_NoLoops();
}
vs. what is really going on:
void LookMa_NoLoops()
{
for(int i=0; i<100; i++);
}
Marc
|
|
|
|
|
Devil's in the (implementation) details
|
|
|
|
|
|
string[] messages = new string[]{null, "Fizz", "Buzz", "FizzBuzz"};
int acc = 810092048;
int c = 0;
for (int i=1; i < = N; ++i) {
c = acc & 3;
result += (c > 0 ? messages[c] : i.ToString()) + ", ";
acc = acc >> 2 | c << 28;
}
I know this is basically coding hell right here and someone's getting their pull request denied, but I ran across this and had to admire it.
|
|
|
|
|
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
Hey @chrismaunder I think we just found the next programming challenge!
Marc
|
|
|
|
|
You forgot the "-" between chris and maunder
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
That'll be @Chris-Maunder.
BTW, where are the coding challenge results ?
|
|
|
|
|
If oranges were a different color, would we still call them oranges?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Oranges colour depends on where it is grown. Oranges are subtropical fruit and turn orange when the temperature cools. In hot climates they stay green.
Generally when they turn orange they are starting to go off,, but people prefer that colour so the market complies.
So why aren't oranges called greens?
|
|
|
|
|
Because you eat greens with ham black-eyed peas, and cornbread.
|
|
|
|
|
Another perspective: if oranges were a different color normally, would the color orange still be orange?
|
|
|
|
|
Beets me.
|
|
|
|
|
Someone should!
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Yes please.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Argh. I'm seeing red, although I should probably be green with envy.
/ravi
|
|
|
|
|
... weird ... can't seem to quote any signature words ...
(shoots self in foot with felt hat)
|
|
|
|
|
invented red to eat capt then blue to eat ration then should we eat orange? all you can
|
|
|
|
|
yes, because the word comes from the fruit.
|
|
|
|
|
|
That color would be called orange.
|
|
|
|
|
I've got an orange tree in the garden. It's more green and brown than orange.
veni bibi saltavi
|
|
|
|
|
Yes, we would call them #ffe033.
|
|
|
|