Page 1 of 2
Engine In Javascript
Posted: Fri Jul 12, 2013 3:52 pm
by bluefever
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!
Re: Engine In Javascript
Posted: Sun Jul 14, 2013 8:04 pm
by geko
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
Re: Engine In Javascript
Posted: Sun Jul 14, 2013 8:30 pm
by bluefever
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.
Re: Engine In Javascript
Posted: Mon Jul 15, 2013 8:06 pm
by Gerd Isenberg
Thank you! This is fantastic!
Is the Vice code available somewhere?
Re: Engine In Javascript
Posted: Tue Jul 16, 2013 12:05 pm
by bluefever
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
Re: Engine In Javascript
Posted: Fri Jul 19, 2013 11:38 am
by pgn4web
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.
Re: Engine In Javascript
Posted: Fri Jul 19, 2013 2:15 pm
by bluefever
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
Re: Engine In Javascript
Posted: Fri Jul 19, 2013 2:44 pm
by bluefever
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
Re: Engine In Javascript
Posted: Fri Jul 19, 2013 4:36 pm
by bluefever
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
Re: Engine In Javascript
Posted: Tue Jul 23, 2013 12:19 pm
by pgn4web
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.