<pedrocorreia.net ⁄>
 

<Programming Puzzles, Chess Positions and Huffman Coding ⁄ >




clicks: 145 145 2009-12-08 2009-12-08 goto programacao myNews programacao  Bookmark This Bookmark This


Now I'll admit that I love this kind of question. I'm not really such a big fan of Code Golf as that's an exercise in writing terse, unreadable code (although some of the solutions have been brilliant). But this Chess problem is the sort of thing that will allow a programmer to demonstrate his or her mental acuity and problem solving ability (or the lack thereof).

The Problem

What is the most space-efficient way you can think of to encode the state of a chess game (or subset thereof)? That is, given a chess board with the pieces arranged legally, encode both this initial state and all subsequent legal moves taken by the players in the game.

This image illustrates the starting Chess position. Chess occurs on an 8x8 board with each player starting with an identical set of 16 pieces consisting of 8 pawns, 2 rooks, 2 knights, 2 bishops, 1 queen and 1 king as illustrated here:



este é só um excerto do artigo, para aceder ao artigo completo, clique no link em baixo:
this is just a small excerpt from the article, to access the full article please click in the link below:

http://www.cforcoding.com/2009/12/programming-puzzles-chess-positions-...




Subscribe News RSS  Subscribe News Updates by E-mail





myNews <myNews show="rand" cat="programacao" ⁄>

Pivot tables in PHP

In my work as developer I normally need to transform data from one format to ano (...)

clicks: 120 120 2010-01-25 2010-01-25 goto url (new window) gonzalo123.word... goto myNews programacao


How To Create Depth And Nice 3D Ribbons Only Using CSS3

In this last period on PV.M Garage we have described many trends of the modern W (...)

clicks: 110 110 2010-01-12 2010-01-12 goto url (new window) pvmgarage.com/e... goto myNews programacao


Partial Application in JavaScript

Partially applying a function is a, particularly, interesting technique in which (...)

clicks: 401 401 2008-02-15 2008-02-15 goto url (new window) ejohn.org/blog/... goto myNews programacao


70+ Ajax techniques you just can't afford to miss

In this article tripwire magazine present a list of more than 70 useful AJAX-bas (...)

clicks: 258 258 2009-03-19 2009-03-19 goto url (new window) tripwiremagazin... goto myNews programacao


20+ Striking Hi-Res Adobe Flash Tutorials

We have made some of the video tutorials for Adobe Flash CS4 Video, here is very (...)

clicks: 356 356 2009-07-22 2009-07-22 goto url (new window) tutoriallounge.... goto myNews programacao


Language Equivalents

This article summarize popular programming concepts with side-by-side code examp (...)

clicks: 291 291 2009-01-23 2009-01-23 goto url (new window) dotnetoutsource... goto myNews programacao


Facebook Hopes to Revolutionize PHP with HipHop

Little did we know that, for the last six months, Facebook has made use of a cus (...)

clicks: 87 87 2010-02-03 2010-02-03 goto url (new window) net.tutsplus.co... goto myNews programacao


23 Best jQuery Facebook Style Plugins

The Facebook User Interface is one of the most popular, attractive and simple to (...)

clicks: 219 219 2009-12-08 2009-12-08 goto url (new window) jquery.wisdompl... goto myNews programacao