Slashdot Mirror


User: DougSuerich

DougSuerich's activity in the archive.

Stories
0
Comments
3
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 3

  1. Chess Joke on So You Think Physics is Funny? · · Score: 2, Funny

    Only the hardcore chessnuts will get this one:

    Q: What's the best defence against the sicilian?

    A: 1. d4!

  2. GNUChess on Humankind Makes Last Stand Against Machine · · Score: 1
    You are too pesimistic. Any encoding I could come up with would be less than 96 bytes, I honestly cannot say how you would be able to use that much.

    If you look at the source code for GNUChess, you can see that this is effectively how they store the board.

    IIRC: Start with an 8 byte array, thus 64 bits (= number of squares on the board).

    Create one of these arrays for each type of piece: White King, Black King, White Queen...etc. In the array, flip the bit to one if that piece is there, and zero if it is not.

    There are 12 possible pieces, and thus 12 * 8 = 96 bytes. Obviously this doesn't account for the extra information of ability to castle and whatnot, but it gives you the basics.

    The advantage to this datastructure is that it makes things really easy to work with. To get the entire board, you can just OR all the bit masks together. To check for what pieces you might attack, just AND it against another array that represents where you can move. Bit operations are cool once you get the hang of them.

    Your structure is likely efficient, but a real PITA to work with.

  3. Our Solution: Open source if support stops on What Will Happen to Rented Software When Its Publisher Sinks? · · Score: 1

    We rent our software to Limousine companies. When we first started this licensing method, many of our customers raised this exact problem. Our solution? Our contract states that if we ever stop providing support for the product, then the source code (which is held in escrow) automatically becomes open source.