Welcome to MSDN Blogs Sign in | Join | Help

Bit-cycling

“The greatest challenge to any thinker is stating the problem in a way that will allow a solution.” —Bertrand Russell

News

  • Disclaimer: By offering suggestions through this page, you give Microsoft full permission to use them freely. We can't guarantee we will use your suggestions, but we will review them for use in future products. Due to the volume and variety of suggestions, we can't provide compensation or personal responses to each suggestion. All opinions are mine, and mine alone, and not those of my employer. Any posts are presented "AS-IS" and confer no rights.
Chess in Silverlight 1.1 Alpha

The Silverlight folks have created a chess-playing demo in Silverlight 1.1 Alpha.

The game is here: http://silverlight.net/samples/1.1/chess/run/default.html (credits and other samples here)

Silverlight 1.1, for those who don't know, is the version of Silverlight that supports the .Net framework. So the point of this demo is to demonstrate how much faster JIT-compiled managed code (C#) is than interpreted Javascript.  Each side can be played by a human, or by an implementation of a chess-playing algorithm written in either C# or JScript. Presumably, when played by the computer, each side is only given a specific amount of time in which to select a move. The quality of that move will depend on how many moves (nodes in the tree) the implementation can analyze in the allowed time. 

The screenshot below is a typical game (the .Net algorithm is playing white at the bottom). As you can see, the .Net implementation gets to analyze about 1000x more moves than the Javascript implementation in the time allotted. As a result, it invariably wins. 

image

Now, if you're a bit bored, you can try something mildly amusing. About half-way through the game, as the .Net side is moving in for the kill, click on the player buttons at the bottom and top to switch which implementation is playing which side. It can be interesting to watch the .Net implementation start trying to dig its way out of the hole. In most runs that I tried, it was usually able to pull out a win (though in one case, it was only able to force a stalemate).

PS. You'll need to install Silverlight 1.1 Alpha from here, if you don't have it.

Posted: Friday, June 01, 2007 7:57 AM by justsean

Comments

No Comments

New Comments to this post are disabled
Page view tracker