« Visual WebGui, a new unique aproch for developing AJAX applications | Main | YShout, A PHP and AJAX powered shoutbox »

First implementation of a chess engine in JavaScript

Today Morfik released version 0.4 of the Morfik Chess application. This version uses a chess engine developed with WebOS AppsBuilder using Object Pascal and which is compiled into pure JavaScript and HTML so that it can run in the browser. It is able to compute at least 2 moves deep. This is probably the world’s first implementation of a chess engine in JavaScript.

http://ajax.phpmagazine.net/upload/2006/04/chess-thumb.png

This alpha-version Chess game can be played as a single player or a multi-player networked game. If you choose the 'Single Player Game' mode, you will be playing against the world's first JavaScript Chess Engine which is running within your browser. This release sees a couple moves ahead, i.e. this is not (yet) a demonstration of a JavaScript Grandmaster.......

If you choose the 'Multi-Player Game' mode, you will again be playing via an application which is running in your browser, i.e. you initiate the browser chess game and invite your friend to join the game using her/his browser. This game takes place without utilizing a central server.

This endeavor is driven by the belief that the frontiers of browser applications have not yet been reached for three reasons:

- Current applications written for the browser are limited because they use hand coded JavaScript. Strongly-typed compiled languages follow a rigorous programming model that has made compilers the preferred tool for building large and complex applications. Compiled code is, by definition, more reliable and scalable than interpreted code. Although the client-side code generated by AppsBuilder is JavaScript, rigorous type-checking and enforcement of referential integrity by the compiler produces reliable and scalable AJAX.

- Browsers ‘raw power’ is progressing significantly due to competition. What was difficult to do yesterday is possible today and will be easy to accomplish tomorrow.

- The mindset of developers needs to shift further towards the browser, i.e. it is not just a ubiquitous presentation level but also a ubiquitous OS layer. We may remember the days when developers were asked to move from DOS to Windows. How often the concern was raised that Windows based applications ran slower than those in DOS (and anyway it was only fancy graphics)….but as improvements were made the vision and reality of what could be delivered merged. We are today at the same juncture with regards to browsers. This need to change in order to meet the future. And the future is good.

Bookmark this article at these sites
Comments
1

I'm afraid this isn't the first JavaScript chess engine- someone beat you to it by several years.

2

Too many bugs, weak engine (i got rid of it) and no source code available.
If they release the code for the public, it would be better.

3

Swobodin it's an experimental stuff, the application have been converted from Object Pascal not directly written in javascript. I can imagine writing everything in javascript would be very complex

4

Looks like a great project to me!

The chess layout is clean (from the screen shots at least) and the options (vs. computer, chat, print, annotation) are nice.

Not sure if the first couple comments are warranted. Did the previous Javascript chess algorithm offer you to play against a built-in AI? Also, this is just an Alpha-release, so you can't really complain that it's "not ready" when the script author already told you that, can you?

5

> Did the previous Javascript chess algorithm offer you to play against a built-in AI?

Yes, google for "javascript chess neil pearce". It was done (in a single day) in 2001 - it came second in the EJB-JS competition.

Post a comment





(Email will remain hidden)





Please enter the security code you see here




Related entries
Email to a friend
Email this article to:


Your email address:


Message (optional):