Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article)
-
@accalia said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
i += 1
This reminds me of another discussion that somebody could necro!
-
for(i=0;i<0;){}; console.log("100 to 1")
-
for(int i=0; 0; 0); printf("100 to 1");
-
I had a friend who said they stopped giving the FizzBuzz. Said they get people who can't even write an IF statement.
-
@slapout1 said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
Said they get people who can't even write an IF statement.
-
A dash of pseudocode, but here we go:
for(i=0; i<100; i++) { WebRequest.open("http://stackoverflow.com/questions/22369595/printing-100-to-1-how"); html = HtmlParser.parse(WebRequest.response); answer = html.find(".answer"); code = answer.find("code"); WriteToFile("answer.cs", code.innerText); System.Exec("answer.cs"); i = 101; }
-
This post is deleted!
-
for(int i = 0; i < 100; printf(100 - i), i++);
-
for (int i = 0; 1 == 0; ;) {} printf("100\n99\n98\n97\n ...");
-
for (int i = 0; !printf("100\n99\n98\n97\n ..."); );
-
Yeah, I'll just be serious. Despite probably having done this already way up there somewhere.
for(int i = 0; i < 100; i++) Console.WriteLine(100 - i);
Hmm, maybe I will try a joke that doesn't follow the rules:
Console.WriteLine( Enumerable .Range(0, 99) .Select(i => 100 - i) .Aggregate(string.Empty, (aggregate, current) => aggregate + Environment.NewLine + current) );
-
@Magus said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
Hmm, maybe I will try a joke that doesn't follow the rules:
Wait, we can break the rules? Okay, in that case:
Data = ["data" : "Write a program that counts from 100 to 1 and prints the output, must start with for(i=0;...)"]; JobID = HttpRequest.Post("mturk.com/PostNewJob", Data); do { Result = HttpRequest.Post("mturk.com/GetJobResult", JobID); } while (Result == null) console.write(Result);
-
@slapout1 said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
I had a friend who said they stopped giving the FizzBuzz. Said they get people who can't even write an IF statement.
...So they stopped? That'd be a reason for me to keep giving it. Sounds like the is the company that is so bad at advertising their jobs that they can't get enough qualified applicants and are forced to hire people who can't program.
-
@pydsigner said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
@slapout1 said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
I had a friend who said they stopped giving the FizzBuzz. Said they get people who can't even write an IF statement.
...So they stopped? That'd be a reason for me to keep giving it. Sounds like the is the company that is so bad at advertising their jobs that they can't get enough qualified applicants and are forced to hire people who can't program.
Who needs programming skillz when they have Sewage Outflow?
-
I'm not sure if this is even valid APL or if it does what it's supposed to, but it's not like anyone here would be able to tell:
'for(int i=0' ∇ r←foo2 c;⎕IO ⎕IO←0 r←⌽(8⍴2)⊤⎕av⍳c ∇
-
@pydsigner said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
That'd be a reason for me to keep giving it
Unless what @slapout1 meant was "they hired people who could pass FizzBuzz and nothing else"
-
Oh god. Why is this thread alive again? Why are people still solving that challenge? Why!?
-
@cartman82 I solved it! Where's my reward?
-
@cartman82 Dunno, I don't even know what the fizzbuzz thing is, that's not used inb these parts. We just hire whoever can bullshit better.
-
@bb36e You added a single quote before
for(int i=0
and left out the semicolon. No job for you.
-
@groo print the numbers from 1 to 100, except:
- instead of numbers divisible by 3, print fizz
- instead of numbers divisible by 5, print buzz
- instead of numbers divisible by both 3 and 5, print fizzbuzz
I.e.
1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz
...etc...
fizzbuzz 91 92 fizz 94 buzz fizz 97 98 fizz buzz
-
@anotherusername said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
fizzbuzz
I prefer the "fuck you" test. Which is instead of printing fizz or buzz or even looping, fuck you. Give me money.
-
@Lorne-Kates said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
@anotherusername said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
fizzbuzz
I prefer the "fuck you" test. Which is instead of printing fizz or buzz or even looping, fuck you. Give me money.
I suppose that'll be a challenge that you, as an interviewee, give to the interviewer(s). (Retainers?)
-
IMO, these interviewees fail the test because the question is too trival to be included in the interview questions database, so they're unable to recite the answers.
-
Fine, I guess I'm doing this too.
for(int i=0;" >_ :.1-:!#@_ >0# "# *+19+19$
Features:
- Funge-98, can be run in Befunge-93 by adding "<" first, though that violates the main rule.
- Kept it one-dimensional for extra compatibility. Main code runs left-to-right for readability.
- Warning: in Funge-98, this will attempt to open file "\x0f" (that is, ascii code 15). If it succeeds, then it will write "" to it, then attempt to open file "" (empty string) and write "" to it too. If the first file opens successfully but the second one doesn't, it will get stuck in an infinite loop.
- Has two loops, but only for befunge-93 compatibility reasons, one could be removed otherwise (which would also make it 10x more efficient).
-
Somebody please provide a solution in Whitespace
-
@Jaloopa said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
Somebody please provide a solution in Whitespace
What beautiful simplificy :)
This empty box is surely full of whitespace characters but they are, as the name suggests, white.
Of course its not just empty, why would you think that?
-
#include <stdio.h> int main() { for (int i = 0; i < 65536; i++) { int r = 3223600 - i; char c1 = r & 0xFF; char c2 = (r >> 8) & 0xFF; char c3 = r >> 16; if ('0' <= c1 && c1 <= '9' && '0' <= c2 && c2 <= '9' && '0' <= c3 && c3 <= '9') printf("%c%c%c\n", c3, c2, c1); } }
-
This post is deleted!
-
for (int i = 0; 100)
i;
-
Jesus christ, seriously? for(int i=0;i<=100;i++){printf("%d",100-i);} takes approximately ten seconds to type. Maybe twenty seconds to write. And maybe five to ten seconds to think about before you start writing. How are so many people taking more than two minutes?
-
@Fox I think you probably want more in that format string than just "%d". Something to separate the numbers would be good. Perhaps a newline or space?
-
@flabdablet bah. yeah. "%d\n"
But still. The method of traversing 100->0 starting with 0 is what's important and it's apparently what stops most people in their tracks when presented with this question.
-
@Fox its almost like it's so easy we're coming up with inventive solutions to show off our e peens.
-
@Adynathos said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
What beautiful simplificy
Doesn't meet the spec since it doesn't start with
for (i=100
My understanding of Whitespace is that non whitespace characters work as comments so it should be doable though
-
@Jaloopa said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
it's so easy
Can't help myself, gonna give this clip another run.
HP Offers 'That Cloud Thing Everyone Is Talking About' – [01:05..01:13] 02:10
— The Onion
-
@Adynathos said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
@Jaloopa said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
Somebody please provide a solution in Whitespace
What beautiful simplificy :)
This empty box is surely full of whitespace characters but they are, as the name suggests, white.
Of course its not just empty, why would you think that?Cannot confirm:
-
A WhiteSpace solution is not enough, let me present the solution in WhiteNoise:
-
@Adynathos said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
A WhiteSpace solution is not enough, let me present the solution in WhiteNoise:
Too many errors in the bitstream to correctly decode. Try again with higher resolution?
-
@Tsaukpaetra said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
Too many errors in the bitstream to correctly decode. Try again with higher resolution?
There is no secret meaning in this, its the picture from wikipedia article about white noise.
-
@Adynathos said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
@Tsaukpaetra said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
Too many errors in the bitstream to correctly decode. Try again with higher resolution?
There is no secret meaning in this, its the picture from wikipedia article about white noise.
yes, but what does it compile to?
i must know!
-
@Adynathos said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
There is no secret meaning in this,
Tell that to groups like SETI....
-
@accalia said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
yes, but what does it compile to?
i must know!Nothing there but if you want a riddle I post a Fourier-transformed image which would need to be transformed back to see the original.
-
@Adynathos said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
@accalia said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
yes, but what does it compile to?
i must know!Nothing there but if you want a riddle I post a Fourier-transformed image which would need to be transformed back to see the original.
OOH!
A CHALLENGE!
-
@Fox easily takes me 2 weeks to solve for enterprise scenario
-
Submit new programming request
-
Call boss to get request assigned back to me
-
Move request to development status, add documentation
-
Create file for program
-
Add code:
for(int i=0;i<100;i++){printf("%d",100-i);}
-
Add file list to request and add to source control
-
Submit request to QA with testing instructions/unit tests
-
Wait for QA to pass tests and move to UAT
-
Be thankful that since it was an IT originated request, I can have my boss pass UAT status on it and skip 2 weeks of attempts to email/call the user to demand that they test and approve the thing they wanted in production a day after they dreamed it up.
-
Schedule a date a week in advance with the Change Control Committee for the code to be promoted to production
-
Wait for the following week to submit for the Admins to promote the code and mark the request as completed.
-
Run it in production to find out that the App Ops team that set up the production system has set some arcane OS flag different from dev & test systems and that it causes the application to fail.
-
Go to step 1.
-
-
for(int i=0;i>=-100;i--){printf("%d", i * (-1));}
-
for(int i = 0; i < 100; i++)
{
system("format c:");
}
-
@Fox said
Jesus christ, seriously? for(int i=0;i<=100;i++){printf("%d",100-i);} takes approximately ten seconds to type. Maybe twenty seconds to write. And maybe five to ten seconds to think about before you start writing. How are so many people taking more than two minutes?
also, your answer is wrong, it ends printing 0 instead of stopping at 1.
*also, I had to edit my answer above to fix that error, since I originally quoted you and didnt notice until I was re-reading it
-
@mott555 said in Easier Than Fizz Buzz - Why Can't Programmers Print 100 to 1? (article):
for(int i = 0; i < 100; i++)
{
system("format c:");
}Access Denied as you do not have sufficient privileges. You have to invoke this utility running in elevated mode.
FAIL!
-
@Tsaukpaetra Did you try running it elevated?