In the cinema tonight, they sit and watch the robots fight. The human beings don't have much to say. -- Joe Jackson
Chess is one of those things nerds are supposed to be good at, like long division and the violin and quoting Monty Python movies. I am only good at one of those things, although I am able to play Wild Thing on the guitar and could once list the firing order of a 351 Cleveland off the top of my head. I suppose that's what comes from misspending one's youth in beer and dating.
Still, we forever seek the approval of our peers, so I have spent many an hour getting humiliated by various and sundry chess programs. This went as far back as the Atari 2600, which if I recall correctly didn't so much win as it did throw up a "thinking" screen until you either lost interest or pulled the plug. Checkmate, squishy biped. These days there's MINIMAX and tree pruning and conjugate gradient with simulated annealing, but I think advances in chess games mostly come down to hardware with a MFLOP redline some radians beyond what a Z80 could offer. As they say, a large enough quantitative change becomes a qualitative change.
What does any of this have to do with Javascript? Read on.
Fast forward a few decades and now the computers are regularly besting the best human players we humans are able to field. Skynet incarnate. It's only a matter of time before we just let them run things. After all, chess has been called the Game of Kings (has it been called that? Let's assume so) and democracy is getting a little long in the tooth, so perhaps it's the computer's turn to rule. (I was quietly hoping some kind of sentient plant might rescue us, but I digress.)
The point being, there's much to commend in the inverted classroom model and chess is no exception. Keeping your shame between you and an unjudging, unfeeling, unblinking teacher encourages encouragement and discourages the other thing, at least that's what Salman Khan would have us believe. Yet, someone in Cupertino seems to have not got the memo. All the chess apps that run on my iThings invariably wipe the floor with me regardless of what difficulty setting I choose. Dear Apple: When I select "easy" from the Preferences I do not mean "slightly less Vulcan." If I wanted to be shamed and disgraced, I'd go dancing.
Alas, until somebody invents a computer that feels pain (go on, say "PC load letter" one more time) it falls to LabKitty to put the genie back in the bottle. Enter: Chess Potato. A Javascript implementation of the world's worst computer chess player.
Watch Chess Potato twist in the wind while you gleefully butcher its capacity to make war, one piece after another. A binary deer caught in the headlights. The program doesn't even check if you're making a legal move, so you can stomp its king on move #1 if you choose to do so (move by clicking on a piece, then drag to a new position and release). However, playing by the honor system will make your victory sweeter. That being said, a few compromises needed to be made. The program doesn't understand castling, or en passant. Promotion is automatically to queen. Also, Potato doesn't recognize if you've put it in check (or vice versa), nor will it move to protect its king when you've done so. It falls to one of you to put the knife in to end the game (BTW, the king is the piece with the round crown). As you might expect, your browser must have Javascript turned on to play, and also be running something that recognizes canvas objects and UTC characters.
But let's stay focused on the big picture: If you have ever suffered at the hands of one of these smirking wire monkeys, your deliverance is at hand. I dare say if you cannot beat Chess Potato you might want to look into getting an MRI. Seriously. About the only way it could play worse is if I was picking its next move.
As always, please email me any bugs you happen to find.
Enjoy.
UPDATE: Apparently, Chess Potato is not working in Chrome.
UPDATE 2: Okay, I think the Chrome bug is fixed. Fingers crossed...
UPDATE 3: I've changed movement from click-and-drag to: 1) click on piece, 2) click on destination. This so that Chess Potato plays nice with mobile devices (which intercept drag events instead of passing them on to Javascript which I only discovered last weekend after finally giving in and buying a smartphone so I can look at all the ways LabKitty is broken under iOS and Android. Which none y'all told me about even though I asked you to and at least one of the literally dozens of people who have visited the page must have been using a phone. Just a simple: Hey, Kitty. This is broken. You suck. Is that too much to ask? Do you think it would hurt my feelings? I went to grad school. I don't have feelings.
Chess is one of those things nerds are supposed to be good at, like long division and the violin and quoting Monty Python movies. I am only good at one of those things, although I am able to play Wild Thing on the guitar and could once list the firing order of a 351 Cleveland off the top of my head. I suppose that's what comes from misspending one's youth in beer and dating.
Still, we forever seek the approval of our peers, so I have spent many an hour getting humiliated by various and sundry chess programs. This went as far back as the Atari 2600, which if I recall correctly didn't so much win as it did throw up a "thinking" screen until you either lost interest or pulled the plug. Checkmate, squishy biped. These days there's MINIMAX and tree pruning and conjugate gradient with simulated annealing, but I think advances in chess games mostly come down to hardware with a MFLOP redline some radians beyond what a Z80 could offer. As they say, a large enough quantitative change becomes a qualitative change.
What does any of this have to do with Javascript? Read on.
Fast forward a few decades and now the computers are regularly besting the best human players we humans are able to field. Skynet incarnate. It's only a matter of time before we just let them run things. After all, chess has been called the Game of Kings (has it been called that? Let's assume so) and democracy is getting a little long in the tooth, so perhaps it's the computer's turn to rule. (I was quietly hoping some kind of sentient plant might rescue us, but I digress.)
The point being, there's much to commend in the inverted classroom model and chess is no exception. Keeping your shame between you and an unjudging, unfeeling, unblinking teacher encourages encouragement and discourages the other thing, at least that's what Salman Khan would have us believe. Yet, someone in Cupertino seems to have not got the memo. All the chess apps that run on my iThings invariably wipe the floor with me regardless of what difficulty setting I choose. Dear Apple: When I select "easy" from the Preferences I do not mean "slightly less Vulcan." If I wanted to be shamed and disgraced, I'd go dancing.
Alas, until somebody invents a computer that feels pain (go on, say "PC load letter" one more time) it falls to LabKitty to put the genie back in the bottle. Enter: Chess Potato. A Javascript implementation of the world's worst computer chess player.
Watch Chess Potato twist in the wind while you gleefully butcher its capacity to make war, one piece after another. A binary deer caught in the headlights. The program doesn't even check if you're making a legal move, so you can stomp its king on move #1 if you choose to do so (move by clicking on a piece, then drag to a new position and release). However, playing by the honor system will make your victory sweeter. That being said, a few compromises needed to be made. The program doesn't understand castling, or en passant. Promotion is automatically to queen. Also, Potato doesn't recognize if you've put it in check (or vice versa), nor will it move to protect its king when you've done so. It falls to one of you to put the knife in to end the game (BTW, the king is the piece with the round crown). As you might expect, your browser must have Javascript turned on to play, and also be running something that recognizes canvas objects and UTC characters.
But let's stay focused on the big picture: If you have ever suffered at the hands of one of these smirking wire monkeys, your deliverance is at hand. I dare say if you cannot beat Chess Potato you might want to look into getting an MRI. Seriously. About the only way it could play worse is if I was picking its next move.
As always, please email me any bugs you happen to find.
Enjoy.
UPDATE: Apparently, Chess Potato is not working in Chrome.
UPDATE 2: Okay, I think the Chrome bug is fixed. Fingers crossed...
UPDATE 3: I've changed movement from click-and-drag to: 1) click on piece, 2) click on destination. This so that Chess Potato plays nice with mobile devices (which intercept drag events instead of passing them on to Javascript which I only discovered last weekend after finally giving in and buying a smartphone so I can look at all the ways LabKitty is broken under iOS and Android. Which none y'all told me about even though I asked you to and at least one of the literally dozens of people who have visited the page must have been using a phone. Just a simple: Hey, Kitty. This is broken. You suck. Is that too much to ask? Do you think it would hurt my feelings? I went to grad school. I don't have feelings.
CHESS ♔ POTATO
your browser cannot play chess potato :-(
your browser cannot play chess potato :-(
Click "new game"
http://puu.sh/pFaIU/41b308ed55.png
ReplyDeleteThere can only be one....
This is a great inspiring article.chess and computer programming I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.
ReplyDelete