Engine In Javascript

Code, algorithms, languages, construction...
bluefever
Posts: 22
Joined: Wed Jul 10, 2013 8:23 am

Engine In Javascript

Post by bluefever » Fri Jul 12, 2013 3:52 pm

Hi,

First post for me, long time reader before registering.

Earlier this week I converted an simple C engine I had written into Javascript and last night made a GUI to go with it.

it can be seen here http://www.bluefever.net/Chess/index.html

It's very basic, as is the engine, just for fun - certainly no frills.

I'll be doing a video series on YouTube to explain to anyone curious about starting in CC how it was put together. I am also quite far through a C Engine series with an engine called "Vice"

Playlist for Vice -> http://www.youtube.com/playlist?list=PL ... tZHVbT-2hg
Playlist for un-named Javascript engine -> http://www.youtube.com/playlist?list=PL ... VDA-xafLog

I realise there are a huge amount of experts on here, and the videos I have done are just a bit of hobby fun, nothing more.

Thanks!

geko
Posts: 34
Joined: Mon Aug 01, 2011 5:11 pm

Re: Engine In Javascript

Post by geko » Sun Jul 14, 2013 8:04 pm

nice work bluefever,
with GWT - Google Widget Toolkit (http://www.gwtproject.org) you have all the advantages of Java programming.
In practice converts Java to Javascript

bluefever
Posts: 22
Joined: Wed Jul 10, 2013 8:23 am

Re: Engine In Javascript

Post by bluefever » Sun Jul 14, 2013 8:30 pm

geko wrote:nice work bluefever,
with GWT - Google Widget Toolkit (http://www.gwtproject.org) you have all the advantages of Java programming.
In practice converts Java to Javascript
Thanks, I didn't know about that, but the idea was to write in JavaScript, not use any tools.

I wanted to program it in JavaScript simply for fun.

Gerd Isenberg
Posts: 37
Joined: Wed Jul 07, 2010 11:11 pm
Real Name: Gerd Isenberg

Re: Engine In Javascript

Post by Gerd Isenberg » Mon Jul 15, 2013 8:06 pm

Thank you! This is fantastic!
Is the Vice code available somewhere?

bluefever
Posts: 22
Joined: Wed Jul 10, 2013 8:23 am

Re: Engine In Javascript

Post by bluefever » Tue Jul 16, 2013 12:05 pm

Gerd Isenberg wrote:Thank you! This is fantastic!
Is the Vice code available somewhere?
Hi, thanks very much!

The code is updated in each video, with a link provided.

I guess I can make a "official version" after the next two or three of videos ( want to add null move and hash table, then the series is really finished ) - but the program is really nothing new, I just thought it would be nice to write an engine and make a video series of how it is done.

The only slightly unusual thing is I used Bitboards for the pawns as well as a normal mailbox for pieces.

Thanks again for you interest

pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: Engine In Javascript

Post by pgn4web » Fri Jul 19, 2013 11:38 am

Hello,

playing with your engine I came across a bug: in this position, your engine as White plays the surprising Nf4xe2

[FEN "4r3/3k3p/pr2p3/2p2p2/2Pb1N2/7P/P3R1P1/4R2K w - - 0 1"]
If I take back, then the Re2 turns Black.

Good start anyway, I''m using in my project garbochess.js at the moment, I wonder if you had any idea which one is stronger.

bluefever
Posts: 22
Joined: Wed Jul 10, 2013 8:23 am

Re: Engine In Javascript

Post by bluefever » Fri Jul 19, 2013 2:15 pm

pgn4web wrote:Hello,

playing with your engine I came across a bug: in this position, your engine as White plays the surprising Nf4xe2

[FEN "4r3/3k3p/pr2p3/2p2p2/2Pb1N2/7P/P3R1P1/4R2K w - - 0 1"]
If I take back, then the Re2 turns Black.

Good start anyway, I''m using in my project garbochess.js at the moment, I wonder if you had any idea which one is stronger.
Great, thanks for that, I'll check it out :)

bluefever
Posts: 22
Joined: Wed Jul 10, 2013 8:23 am

Re: Engine In Javascript

Post by bluefever » Fri Jul 19, 2013 2:44 pm

pgn4web wrote:Hello,

playing with your engine I came across a bug: in this position, your engine as White plays the surprising Nf4xe2

[FEN "4r3/3k3p/pr2p3/2p2p2/2Pb1N2/7P/P3R1P1/4R2K w - - 0 1"]
If I take back, then the Re2 turns Black.

Good start anyway, I''m using in my project garbochess.js at the moment, I wonder if you had any idea which one is stronger.
It's somewhere in the null move, or I'm getting a hash collision. I've disabled for now. Thanks again

bluefever
Posts: 22
Joined: Wed Jul 10, 2013 8:23 am

Re: Engine In Javascript

Post by bluefever » Fri Jul 19, 2013 4:36 pm

pgn4web wrote:Hello,

playing with your engine I came across a bug: in this position, your engine as White plays the surprising Nf4xe2

[FEN "4r3/3k3p/pr2p3/2p2p2/2Pb1N2/7P/P3R1P1/4R2K w - - 0 1"]
If I take back, then the Re2 turns Black.

Good start anyway, I''m using in my project garbochess.js at the moment, I wonder if you had any idea which one is stronger.
Ok, it's fixed :) Thanks again

pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: Engine In Javascript

Post by pgn4web » Tue Jul 23, 2013 12:19 pm

Tried to play some other game at 10s per move, but in every game I sooner or later get to the point where the UI does not display a move from the engine anymore. However, if after a short while I hit the takeback button, a completely different position is shown. It looks as if at some point the UI stops updating the chessboard and the engine plays itself quickly.
I dont have an example because I could not reproduce the error systematically just by loading a given position, some historical preconditions seem required to trigger the fault.

Post Reply