|
Dammit Rivorous you're drunk with power
|
# ? May 20, 2013 18:33 |
|
|
# ? Jun 8, 2024 05:55 |
|
That Turkey Story posted:I wanted to go and do it anyway:
|
# ? May 20, 2013 18:43 |
|
That Turkey Story posted:I wanted to go and do it anyway: You're hired. When can you begin?
|
# ? May 20, 2013 19:08 |
|
Sailor_Spoon posted:I plan on memorizing that seed for my next job interview. This owns
|
# ? May 20, 2013 19:48 |
|
Objective-C code:
|
# ? May 20, 2013 19:53 |
|
Wheany posted:This is not particularly clever, but I thought I'd contribute anyway. Fits comfortably in a tweet, no conditionals: Perl code:
|
# ? May 20, 2013 19:55 |
|
Sailor_Spoon posted:
This doesn't seem to work. I just copied the code and got this output instead for the first 15: code:
|
# ? May 20, 2013 19:55 |
|
The random algorithm changed in Python 2.4. That code might be dependent on the Wichmann-Hill Random Number Generator, rather than the Mersenne Twister algorithm. It seems that the Mersenne Twister in Python got updated to use the MT19337-64 variant at some time, which might have broke it.
|
# ? May 20, 2013 19:59 |
|
code:
|
# ? May 20, 2013 20:02 |
|
It works in Python 2.6
|
# ? May 20, 2013 20:05 |
|
Ah, the server I ran it on is running 2.2 apparently. Welp
|
# ? May 20, 2013 20:08 |
|
quiggy posted:Ah, the server I ran it on is running 2.2 apparently. Welp Wow. Out of curiosity, what distribution/version? 2.2 was released in 2001 and hasn't had a release since 2003. That random seed doesn't work on 3.3, incidentally.
|
# ? May 20, 2013 20:17 |
|
I suppose this is what I get for not checking versions on a lovely public university server This particular build is from Mar 27, 2002. It's running on SunOS 10.5, which itself is from Jan 2005. I swear to god I'm not the administrator of this thing.
|
# ? May 20, 2013 20:21 |
|
Oh, yeah, Solaris was kinda behind on its Python version (and plenty of other stuff, too*) for a long time. I get the impression that that's just the nature of enterprisey UNIX distributions. At least they got caught up just before they became Larry Ellison's Patent Suit Data Provider :\ * I have fun writing and continually 'improving' my own find replacement in Python because the one that came with the last Solaris (10-5?) didn't even support -iname which I think is a GNU extension.
|
# ? May 20, 2013 20:47 |
|
Volmarias posted:You're hired. When can you begin? I notice a distinct lack of a return statement from main. They made void legal for a reason!
|
# ? May 20, 2013 20:49 |
|
For bonus points, write a program that finds a seed that works.
|
# ? May 20, 2013 20:50 |
|
If I recall correctly last time this conversation came up someone wrote a genetic FizzBuzz algorithm. Now there's one to share during your job interview.
|
# ? May 20, 2013 20:51 |
|
quiggy posted:If I recall correctly last time this conversation came up someone wrote a genetic FizzBuzz algorithm. Now there's one to share during your job interview. A link to a comedy fizzbuzz github would be a good gauge to see if you'd want to work somewhere.
|
# ? May 20, 2013 20:55 |
|
ymgve posted:For bonus points, write a program that finds a seed that works. How do you think I found that seed?
|
# ? May 20, 2013 20:57 |
|
Also, here's a ruby version that I think I saw on twitter originally, so I can't claim credit for the idea.code:
|
# ? May 20, 2013 20:59 |
|
Sailor_Spoon posted:How do you think I found that seed? How long did it take to run? I'm assuming you just brute-forced it.
|
# ? May 20, 2013 21:48 |
|
Munkeymon posted:How long did it take to run? I'm assuming you just brute-forced it. Yeah, I think I just let it run overnight. It wasn't quick, though I didn't really try to optimize.
|
# ? May 20, 2013 22:17 |
|
hobbesmaster posted:I notice a distinct lack of a return statement from main. They made void legal for a reason! You're fired. Pack your things and get out.
|
# ? May 20, 2013 22:18 |
|
Sailor_Spoon posted:Yeah, I think I just let it run overnight. It wasn't quick, though I didn't really try to optimize. And I was just about to ask. Hah, cool. You know what would make a good weed-out question? Flip it, instead of asking them to solve the FizzBuzz, give them all of these solutions and tell them to pick which is most like they'd do it. Then auto-reject most of them. I bet a good number of the programmers who can't program would opt for the enterprise solution. Alternatively, take one of the really pedantic implementations, break something, and ask them to find the bug. If they can put up with that nonsense, they're hired! Course then you have to assure them your codebase doesn't actually look that horrible.
|
# ? May 20, 2013 23:08 |
|
Sailor_Spoon posted:How do you think I found that seed? By finding it on a site before? I found this from 6 months ago.
|
# ? May 21, 2013 00:07 |
|
Am I too late for the fizzbuzz game? The random seed one inspired me.C code:
|
# ? May 21, 2013 04:51 |
|
What have I doneC++ code:
Volte fucked around with this message at 07:46 on May 21, 2013 |
# ? May 21, 2013 07:38 |
|
I'm lost, what is all of this fizz buzz poo poo?
|
# ? May 21, 2013 08:35 |
|
QuarkJets posted:I'm lost, what is all of this fizz buzz poo poo? http://en.wikipedia.org/wiki/Fizz_buzz quote:Fizz buzz (also known as bizz buzz, or simply buzz) is a group word game for children to teach them about division.[1] Players take turns to count incrementally, replacing any number divisible by three with the word "fizz", and any number divisible by five with the word "buzz". http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html quote:After a fair bit of trial and error I've discovered that people who struggle to code don't just struggle on big problems, or even smallish problems (i.e. write a implementation of a linked list). They struggle with tiny problems. I was also going to say that it's one of the few worthwhile things that Jeff Atwood has ever actually contributed to software development, but it wasn't even his idea. Also, http://rosettacode.org/wiki/FizzBuzz
|
# ? May 21, 2013 09:27 |
|
Volte did you make all that up just for this or is it a transformation you adapted?
|
# ? May 21, 2013 13:12 |
|
Zaphod42 posted:You know what would make a good weed-out question? Flip it, instead of asking them to solve the FizzBuzz, give them all of these solutions and tell them to pick which is most like they'd do it. Then auto-reject most of them. I bet a good number of the programmers who can't program would opt for the enterprise solution.
|
# ? May 21, 2013 14:51 |
|
Dren posted:Volte did you make all that up just for this or is it a transformation you adapted?
|
# ? May 21, 2013 14:57 |
|
Volte posted:I wrote it by hand for some reason. I wanted to see if I could do it in a single loop with no conditionals, divisions, or mod operators. Plus I made it as obfuscated as I could. A single loop with no conditionals or divmods is kind of easy though: code:
|
# ? May 21, 2013 15:20 |
|
Jabor posted:A single loop with no conditionals or divmods is kind of easy though:
|
# ? May 21, 2013 15:24 |
|
Here is my solution with no conditionals or divmod. printf("1 2 fizz 4 buzz 6 ...")
|
# ? May 21, 2013 15:24 |
|
Volte posted:I wrote it by hand for some reason. I wanted to see if I could do it in a single loop with no conditionals, divisions, or mod operators. Plus I made it as obfuscated as I could. You did quite a bit of division and multiplication by powers of 2.
|
# ? May 21, 2013 15:31 |
|
Suspicious Dish posted:By finding it on a site before? I found this from 6 months ago. heh, that's actually me.
|
# ? May 21, 2013 17:26 |
|
This one is my favorite fizzbuzz: http://dotnetpad.net/ViewPaste/SrmP90hoE02rYAyTIVHc3w
|
# ? May 21, 2013 23:23 |
|
Parallel fizzbuzz:C++ code:
code:
|
# ? May 22, 2013 00:26 |
|
|
# ? Jun 8, 2024 05:55 |
|
b0lt posted:
Ugggh gross, use a condition variable, you monster
|
# ? May 22, 2013 00:33 |