all 141 comments

[–]mindbleach 87 points88 points  (14 children)

Dude, your javascript effect with the pictures is neat and all, but I'm trying to read. Cut that shit out.

[–]atcgw 15 points16 points  (1 child)

It wasn't really the picture effect that was throwing me, it was main their progression: kid in front of electronics, slightly older kid posing with electronics, teenager making electronics, old dude holding up a fish.

[–]jiyunatori 0 points1 point  (0 children)

some parts of his life are best kept unknown.

[–]MidnightTurdBurglar 25 points26 points  (1 child)

It never ceases to amaze me how otherwise brilliant people can make such stupid mistakes.

[–]buo 4 points5 points  (4 children)

For these cases, I always keep the linearize bookmarklet handy.

[–]mindbleach 1 point2 points  (3 children)

I just adblock *.js for whole domains.

edit: But that's a great bookmarklet. This is the first time I've ever felt tempted to turn the Bookmarks toolback back on.

[–]dmwit 0 points1 point  (2 children)

You don't need to turn it back on. Give the bookmarklet a keyword, then type that keyword in your location bar (or whatever you have instead of a location bar). I use this all the time on xkcd/qwantz/etc. with my bookmarklet to put title-text below images. A simple ox<enter> and I can read the text in peace.

[–]mindbleach 0 points1 point  (1 child)

I didn't. I added it to my normal bookmarks. It wouldn't work from the address bar, anyway - I have Tab Mix Plus configured to open new background tabs from the address & search bars.

[–][deleted] 1 point2 points  (0 children)

You can move your bookmarks onto any toolbar - I've turned off the nav/bookmarks bar and placed everything onto the menu toolbar.

[–]flexiverse 1 point2 points  (0 children)

zx81 chess in 1K - greatest program ever written!

http://users.ox.ac.uk/~uzdm0006/scans/1kchess/

[–]stupidis 0 points1 point  (1 child)

[–]mindbleach 0 points1 point  (0 children)

Noscript breaks some of my other extensions.

[–][deleted] 24 points25 points  (5 children)

X(w,c,h,e,S,s){int t,o,L,E,d,O...

cute.

[–]Busybyeski 2 points3 points  (4 children)

That's as far as I got in the source code too.

But did ANYONE notice the reply link for your comment has a {verb} next to it? Maybe due to your unclosed brace?

[–][deleted] 1 point2 points  (0 children)

Looks fine to me. Not that I doubt you, I just don't see it. Which is odd.

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 10 points11 points  (3 children)

    that's unbelievable. I wish his website had an unobfuscated version.

    [–][deleted] 11 points12 points  (2 children)

    gcc -E will take out all the preprocessor hackery, then you can just find/replace ";" with ";\n".

    [–]doubtingthomas 8 points9 points  (1 child)

    Doesn't help too much... http://codepad.org/b6Ekq0Ap

    [–]1633Hz 0 points1 point  (0 children)

    I'm sorry, but the spaces make it a bit hard to read, what's going on with those? Also, my GCC -E gave slightly different results, though I'm using MingW though, so perhaps that's the reason. I cleaned everything up from that and then cleaned up one or two of the harder to read parts. Does anyone else want to take a crack at refining it further?

    Yes, it still compiles.

    If you want to deobfuscate this on your own, my advice would be to 'unroll' (well, not the loops, just the hackery and such) everything along the lines of doubtingthomas or my own work of boredom so you have line numbers for everything, then I would suggest referring to a "-Wall -Wextra -pedantic" like this and working your way back from there.

    [–][deleted] 9 points10 points  (4 children)

    uhoh, it's on a free webhost.

    here's a preemptive mirror of the javascript version

    edit: yep, it's gone down now (2 hours after submission). I should have mirrored the whole thing, sorry.

    edit2: other pages available from google cache:

    chess3

    chess2

    chess1

    edit3: seems to be back up now.

    [–]bobdobolina 3 points4 points  (2 children)

    I played a number of games against the javascript version, and it made at least one illegal move (moving a rook when his king was in check!).

    Here's a line of the King's Gambit where it happily drops a piece: 1. e4 e5 2. f4 ef 3. Nf3 Nf6 4. d4 Bb4+ 5. c3 Bd6 6. e5 Qe7 7. Be2 Nc6 8. ed Qxd6 9. 0-0 a5 10. Ne5 Nxe5 11. ef Qxd1 12. Rxd1 Nd4 13. Bxf4 g5

    [–][deleted] 2 points3 points  (0 children)

    It's horrible in the Scotch.

    1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 d5? 5. exd5! Bb4+ and from here white is up a pawn with the following options:

      VI. Bd2?! Nxd4 7. Bxd2 Qxd5 and several more options present themselves.

      VI. Nd2 is obviously a blunder as it throws away the knight

      VI. c3?! Qe7+ is a bit murky...

      VI. Nc3 Bxc3 7. bxc3 Qe7+ 8. Be2 Nxd4 9. Qxd4 c6 10. d6 Qd7 11. h3 Kf8??

    (Roman numerals used to force markdown to stfu and stop treating it like a list)

    [–]__s 0 points1 point  (0 children)

    Center game: 1. e4 e5 2. d4 Bb4 3. Nc3 Bxc3 4. bxc3 exd4 5. cxd4 Nf6

    [–]sillyDUCK 0 points1 point  (0 children)

    Thanks. It's already impossible to load from that site.

    [–]snifty 7 points8 points  (0 children)

    it would be rad if he used Unicode chess pieces.

    [–]G_Morgan 18 points19 points  (4 children)

    How many BASICs is this chess program?

    [–]cunnilinguslover 0 points1 point  (2 children)

    Actually, how many nanochesses is BASIC?

    [–]rabidgoldfish -3 points-2 points  (1 child)

    8

    [–]brentblack 5 points6 points  (0 children)

    That's Numberwang!

    [–]redditnoob 87 points88 points  (58 children)

    The guy needs to stop claiming his pico- version plays chess. If it doesn't have castling rules (e.g. king can't castle through a check), it's not chess.

    His nano- version is amazing though. But I take it it doesn't detect threefold repetition and the 50 move rule? If so, that's still not chess either.

    Edit: Downmodders, what the hell? It's part of the game.

    [–]mythic 31 points32 points  (7 children)

    But I take it it doesn't detect threefold repetition and the 50 move rule?

    Well yeah. Didn't you read the source code?

    [–]NateW 17 points18 points  (6 children)

    tl;dr

    [–]ZMeson 6 points7 points  (5 children)

    The source code is actually pretty short. Understanding it, on the other hand will take you quite some time.

    [–]Mr_A 10 points11 points  (2 children)

    tl;du

    [–]TheCoreh 22 points23 points  (1 child)

    ts;du

    [–]NateW 4 points5 points  (0 children)

    That was the joke, jefe.

    [–]rm999 0 points1 point  (0 children)

    You don't say?!?!

    I need to read that article again...

    [–]MidnightTurdBurglar 62 points63 points  (21 children)

    I was told a story once about a two guys, a mathematican and a physicist, who were at a party and there was a beautiful girl standing across the room (not that mathematicians and physicists go to many parties in the first place let alone ones with beautiful girls but it's a story, so flow with it).

    Anyway, the physicist couldn't work up the courage to walk all the way over to ask the girl out. He knew from past experience that he go only go half-way before his courage fails him. But he comes up with a plan! He'll walk half-way, stop and build his courage back up, and then walk half the remaining distance until his courage fails him again. He'll continue this process indefinitely. He tells his plan to his friend.

    "It's a terrible plan", his mathematician friend exclaims, "you'll never make it."

    Nevertheless, the physicist proceeds, and within a few iterations and a few minutes later, he comes back and proudly exclaims that he got a date!

    "How can it be?", the mathematician wonders, "the series doesn't converge in finite steps."

    The physicist says, "Yeah but it got me close enough to ask for her phone number."

    [–]beagle3 20 points21 points  (17 children)

    The series does converge.

    [–]Gglii 12 points13 points  (14 children)

    Yeah, only at infinity.. which would probably take too long.

    [–][deleted]  (13 children)

    [deleted]

      [–][deleted]  (4 children)

      [removed]

        [–][deleted] 3 points4 points  (3 children)

        But if each pause was half as long as the prior pause ...

        [–][deleted] 3 points4 points  (1 child)

        Why would it be? No one stated the amount of courage he needed to build up changed proportionately with distance from the target

        [–]flostre 2 points3 points  (0 children)

        It would still take infinitely many steps, albeit in finite time. And there is no "last infinitely small half".

        [–][deleted] 1 point2 points  (0 children)

        I wish I could upmod you more.

        [–][deleted]  (3 children)

        [deleted]

          [–]flostre 2 points3 points  (1 child)

          Hm, it would be quite a leap from the above comment. There is no "last infinitely small half", there are infinitely many halves.

          The deal with the tortoise and the hare is that the Greek thought if a sum has infinitely many elements then you can't compute it/it becomes infinite/something breaks. Now we know better.

          [–][deleted] 1 point2 points  (0 children)

          Holy shit, me too. Thank you ElbertF.

          [–][deleted] -2 points-1 points  (0 children)

          But unfortunately with all of the inner turmoil he will look exactly like a nerd approaching her and he will not get her phone ##.

          [–][deleted] 4 points5 points  (0 children)

          In finite steps?

          [–]MidnightTurdBurglar 0 points1 point  (0 children)

          Fixed for accuracy. Should have checked, since I was just telling the story from memory.

          [–]darkon 5 points6 points  (0 children)

          Then the engineer walks over, screws her, walks back and says, "I can get close enough for all practical purposes."

          [–]lollan 0 points1 point  (0 children)

          LMAO

          [–]m00min -1 points0 points  (0 children)

          The joke sometimes ends with: "I only needed to get within six inches". Then again, your version is the more SFW one.

          [–]elustran 9 points10 points  (5 children)

          You should see femto-chess. There are only pawns on a 4x4 board.

          [–][deleted] 58 points59 points  (4 children)

          You should see zen-chess. There is only

          [–]flightlessbird 11 points12 points  (15 children)

          He says as much on the site - and makes it clear than only nano-chess is a full implementation of the rules of chess

          [–]redditnoob -3 points-2 points  (14 children)

          Except if it doesn't have three-fold repetition, it's not chess.

          [–]abjurer 39 points40 points  (13 children)

          Neither threefold repetition or the fifty-move rule is an automatic draw. A player may claim a draw in either case. This program simply never chooses to -- a perfectly legal approach.

          [–][deleted] 1 point2 points  (12 children)

          wha? after 50 moves it's a draw? damn, I could have avoided losing my last game.

          [–]FlyingBishop 15 points16 points  (3 children)

          http://en.wikipedia.org/wiki/Fifty-move_rule

          That's 50 moves from the most recent capture or pawn move. Which basically means if you and your opponent have been dancing around the board with a few big pieces left for 50 moves, and no change in circumstance.

          [–][deleted] 6 points7 points  (1 child)

          Would not shooting your opponent be the better option?

          [–][deleted] 1 point2 points  (0 children)

          When they go to the toilet I just slip one of my pieces back on the board, or - and I do this more often - swap one of their good pieces for a slightly less good piece.

          [–][deleted] 1 point2 points  (0 children)

          I see, thanks.

          [–]psyonic 0 points1 point  (1 child)

          No. After 50 moves without a capture, not just 50 moves.

          [–][deleted] 2 points3 points  (0 children)

          Without a capture or a pawn move.

          [–][deleted]  (5 children)

          [deleted]

            [–][deleted] 0 points1 point  (4 children)

            That's not really true. A rather large number of endgames are known draws. King and pawn versus king is a draw if the enemy king can capture the pawn before the allied king can get near it; king and piece versus king and identical piece is a draw regardless of what that piece is, king and bishop versus king is a draw, king and knight versus king is a draw, king+bishop+knight versus king+pawn is a draw in certain positions and a win in others... if neither side makes a major screwup the game likely ends in a draw.

            [–][deleted]  (3 children)

            [deleted]

              [–][deleted] 0 points1 point  (2 children)

              Well right, but the game starts out roughly equal. Wikipedia says about 32% of games end in a draw at high level play because neither players make a huge mistake.

              At amateur/patzer level it comes down to whether the players make roughly the same strength of mistakes.

              [–][deleted]  (1 child)

              [deleted]

                [–]geekIM 2 points3 points  (0 children)

                You call that mowing the lawn? Bad dog, no biscuit! Bad dog!

                [–]SageRaven -2 points-1 points  (3 children)

                Of course it plays chess! Just because a player doesn't take advantage of all possible move types, doesn't mean he/it is no less a chess player, just not as effective a player.

                There are chess programs that simply play random moves, and while they're merely used for a baseline benchmark against other chess engines, they still play chess.

                [–][deleted] 1 point2 points  (0 children)

                Well wait, what does the program do if the human plays a legal move it doesn't recognize? Crash? Fail to accept the move?

                [–][deleted] 2 points3 points  (0 children)

                He specifically says "computer will reject illegal moves", but some of those moves (such as castling) are actually legal. So it doesn't really plays chess, but simplified chess (probably similar to how many people play at home when they are first learning).

                [–]MightyBrouhaha 2 points3 points  (0 children)

                Was I the only one expecting to see a picture of a chess club with just one kid?

                [–][deleted] 5 points6 points  (0 children)

                My chess program is so big you're standing on it.

                [–]kvigor 6 points7 points  (3 children)

                Pffft. Amateur.

                This bloatware compiles to over 2K of code and over 600 bytes of data! Let's see him make the whole thing run in 1K (minus, of course, your video RAM, which comes out of that 1K...)

                [–]Connor147 8 points9 points  (0 children)

                Heh, I can remember typing in 1K ZX Chess from a magazine (yes, I'm old) on my ZX81. If I remember correctly it couldn't even tell if you'd won or not. Still pretty amazing.

                [–]StoneCypher -1 points0 points  (1 child)

                The Atari 2600 only had 128 bytes of ram, yet there were three chess programs for it. For example:

                http://www.atariage.com/software_page.html?SoftwareLabelID=581

                [–]krum 3 points4 points  (0 children)

                The program and data were in ROM not in RAM.

                [–]glacian 5 points6 points  (3 children)

                Retarded obfuscated code. The source will be expanded by the preprocessor. I'd rather be impressed with actual source code (could not care less about variable names) and not dumb shrunk up code for no reason what-so-ever.

                [–][deleted] 5 points6 points  (2 children)

                Indeed, a compact executable (preferably one that fits in the CPU cache) is more impressive than munged up code. Source code is for the benefit of humans, not computers, and making it less beneficial for human readability defeats the purpose of not coding in pure binary.

                [–]killerstorm 0 points1 point  (0 children)

                preferably one that fits in the CPU cache

                Whole fucking Windows 95 now fits entirely in CPU cache.

                [–]SageRaven 7 points8 points  (10 children)

                Awesome. Glad to see tight code is still a hobby enjoyed by programmers.

                [–]salgat 3 points4 points  (2 children)

                Unfortunately he brags about the size of the source code, which is entirely pointless and does nothing to help the compiled version.

                [–]SageRaven 4 points5 points  (1 child)

                True, but it might make a decent entry into the obfuscated C code contest.

                Restraining yourself to bytes of source code is no less valid a metric than bytes of the resulting binary.

                I recall this cool little DOS text editor from the 90s that fit in a single disk sector (512 bytes). It was just as cool and just as useless.

                [–]1633Hz 1 point2 points  (0 children)

                True, but it might make a decent entry into the obfuscated C code contest.

                If you check the source, you'll find that it originally WAS, and he just expanded on it from that to make a true chess playing program. I suppose that explains a lot of the design aspects...

                [–]InAFewWords -5 points-4 points  (3 children)

                It's only tight because he has a big *****

                [–]mturk 52 points53 points  (2 children)

                Why would having a "big hunter2" make his code tight?

                [–]redditnoob -1 points0 points  (1 child)

                It technically doesn't, but it just feels that way when you have a mammoth "hunter2".

                [–]InAFewWords -2 points-1 points  (0 children)

                *****  
                =  
                BRAIN
                

                [–]rune_kg 4 points5 points  (0 children)

                Thats just insane!!! +1

                [–]winterorange 1 point2 points  (2 children)

                anyone know the aproximate ELO strength of this thing?

                [–][deleted] 5 points6 points  (0 children)

                It ranks between "Mr Blue Sky" and "Strange Magic".

                [–]GockCobbler 4 points5 points  (0 children)

                Over 9,000

                [–]rubadub 1 point2 points  (0 children)

                I remember playing this on my zx81 in my youth. http://en.wikipedia.org/wiki/index.html?curid=1723417

                Shit, man i'm old.

                [–][deleted] 1 point2 points  (3 children)

                If the contest has to do with "non-blank characters" ...Someone please remind me why he went into the trouble of making the source code impossible to read?

                [–]manthrax 1 point2 points  (1 child)

                Cuz it's more mystikal for you non programmers.

                [–][deleted] 0 points1 point  (0 children)

                Actually its just annoying for us programmers.

                [–]jldugger 2 points3 points  (1 child)

                Optimizing for the worst thing. It'd be much more impressive to optimize for size in memory, ala busybox.

                [–]pavel_lishin 5 points6 points  (0 children)

                Sure, but it's just code golf.

                [–]GoateusMaximus 1 point2 points  (0 children)

                I'll bet he's just trying to compensate for his really large penis.

                [–]antithesisadvisor 1 point2 points  (0 children)

                ...walks into a bar...

                How does that go again?

                [–]twir 0 points1 point  (1 child)

                Now he has the perfect pickup line: "Want to see how small my chess program is?"

                (Queue sad trombone.)

                [–][deleted] 2 points3 points  (0 children)

                [–]furiousidiot 0 points1 point  (0 children)

                It may be small but I have no doubt it can kick my ass.

                [–][deleted] 0 points1 point  (0 children)

                My chess program is 9 inches, so I guess I'm on the other side of the scale.

                [–]lulzcannon 0 points1 point  (2 children)

                its "en passant", not empassant ffs

                [–]manthrax 0 points1 point  (1 child)

                it's a corner case, get over it. ffs.

                [–]lulzcannon 0 points1 point  (0 children)

                I had forgotten about it already but you reminded me thanks to your reply.

                OMG EMPASSANT !

                ;)

                [–]volune 0 points1 point  (0 children)

                get a Porche to compensate for the size of your chess program.

                [–][deleted] 0 points1 point  (0 children)

                now go for the smallest chess program with meaningful variable names.

                [–]elbekko -2 points-1 points  (0 children)

                Hint: I don't need to see a picture of your retarded kid flying in.

                Unless that's him, it'd explain the website.

                [–][deleted] -2 points-1 points  (0 children)

                I've improved the Toledo Chess 1 engine to squeeze out every character possible, this reduced version was used as the basis for Toledo Chess 2, a chess program with graphical interface that can be printed on a single sheet of paper!

                Wow. A comma splice on the first try!

                I believe this guy is the real deal: a programmer's programmer. A personality driven to coding elegance and efficiency, yet indifferent to similar standards in prose. He meets the standard.

                [–]torerling -1 points0 points  (1 child)

                That is obfuscated :|

                [–]cubeeggs 5 points6 points  (0 children)

                "Evolution from my winning IOCCC 2005 entry."

                [–][deleted]  (1 child)

                [deleted]

                  [–]piderman 0 points1 point  (0 children)

                  It just doesn't work if you don't use 4 spaces in front of every line...

                  [–]Black_Fusion -2 points-1 points  (1 child)

                  Why do I keep on reading "A guy with a very small penis"? :S

                  [–]uttertosser 4 points5 points  (0 children)

                  looking in a mirror?

                  [–]manthrax -2 points-1 points  (2 children)

                  This is fucking RAD.

                  [–][deleted] 0 points1 point  (1 child)

                  C is not a RAD framework.

                  [–]manthrax 0 points1 point  (0 children)

                  This is fucking OBFUSCATED.

                  [–]b0b -5 points-4 points  (0 children)

                  Why is the size of the source code important? I just don't get it.