Created
June 14, 2014 01:05
-
-
Save eidolonrage/6baaaa1eebb511fea46f to your computer and use it in GitHub Desktop.
Nathan's FizzBuzz thingy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 1 | |
for x in range(1,101): | |
y = x%3 | |
z = x%5 | |
if y + z == 0: | |
print 'FizzBuzz' | |
else: | |
if y == 0: | |
print 'Fizz' | |
else: | |
if z == 0: | |
print 'Buzz' | |
else: | |
print x |
lol what the dick?
It certainly looks shorter. I assume the indecipherable bit at the end is the important part...
Edit: I ran it just to see and it, unsurprisingly, works. How the hell? I see something resembling math at the end, but what's the 0x30490610 thing?
There's quite a bit happening in that one line. I split it up into a much longer version with heavy comments explaining how it works:
https://gist.github.com/sunetos/220d770a7080f9ac38c0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To be a jerk, I wrote the most obfuscated (and short) one I could come up with: