JSUCI 1.0 - connect javascript chess engines to UCI

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

phenri
Posts: 284
Joined: Tue Aug 13, 2013 9:44 am

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by phenri »

Ok, nevermind
go movetime 5000
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go depth 2
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go infinite
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
uci
id name p4wn, AKA 5k chess
id author Douglas Bagnall, ported to JSUCI by Edmund Moshammer
uciok
isready
readyok
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
engine.js:31380: Uncaught TypeError: Cannot read property 'board' of undefined
go depth 3
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
Edit: I missed ucinewgame
Its fine now
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Edmund »

phenri wrote:Ok, nevermind
go movetime 5000
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go depth 2
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go infinite
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
uci
id name p4wn, AKA 5k chess
id author Douglas Bagnall, ported to JSUCI by Edmund Moshammer
uciok
isready
readyok
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
engine.js:31380: Uncaught TypeError: Cannot read property 'board' of undefined
go depth 3
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
p4wn requires the

Code: Select all

ucinewgame
command before sending position and go commands
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Adam Hair »

Thanks, Edmund! I look forward to trying this tool out.
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Edmund »

phenri wrote:Edit: I missed ucinewgame
Its fine now
Brilliant, I am glad it is working as expected. Thanks for testing!
phenri
Posts: 284
Joined: Tue Aug 13, 2013 9:44 am

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by phenri »

I just tried to launch stockfish.js and apparently it is not so universal as that.
op12no2
Posts: 489
Joined: Tue Feb 04, 2014 12:25 pm
Full name: Colin Jenkins

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by op12no2 »

Hi Edmund,

Fantastic. I've been playing around with a Javascript engine recently and being able to use a standard UI would be great. I actually started off with similar intentions to your interface but got seduced by the engine.

Lozza uses the JSON web worker interface to do an analysis of N ply with a timeout option.

http://op12no2.me/toys/lozza/lozza.js

Primitive test UI here that runs some perft tests then does a 10 play analysis of the home position and BK positions 1-4.

http://op12no2.me/toys/lozza/test.htm

I will definitely try your interface...
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Edmund »

phenri wrote:I just tried to launch stockfish.js and apparently it is not so universal as that.
Interesting. I invested some time trying to find out why it is not running, but without success. This autogenerated source is not very debug friendly. It might be that one of the node.js malloc functions gets blocked by V8, but I am not certain.
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by Edmund »

op12no2 wrote:Hi Edmund,

Fantastic. I've been playing around with a Javascript engine recently and being able to use a standard UI would be great. I actually started off with similar intentions to your interface but got seduced by the engine.

Lozza uses the JSON web worker interface to do an analysis of N ply with a timeout option.

http://op12no2.me/toys/lozza/lozza.js

Primitive test UI here that runs some perft tests then does a 10 play analysis of the home position and BK positions 1-4.

http://op12no2.me/toys/lozza/test.htm

I will definitely try your interface...
Hey Colin,
I just head a look at your source. It looks very well organized. Connecting it to uci should be straight forward. It is missing an algebraic move parser and would have to change the way of output, but the rest looks suited perfectly. Please let me know if you encounter any dificulties.
All the best
Edmund
op12no2
Posts: 489
Joined: Tue Feb 04, 2014 12:25 pm
Full name: Colin Jenkins

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by op12no2 »

Edmund wrote: I just head a look at your source. It looks very well organized. Connecting it to uci should be straight forward. It is missing an algebraic move parser and would have to change the way of output, but the rest looks suited perfectly. Please let me know if you encounter any dificulties.
All the best
Edmund
Great, thanks for checking it out and the tips. I'll look up the UCI protocol - never done anything with it. Looking forward to getting this going in my Hiarcs UI.
op12no2
Posts: 489
Joined: Tue Feb 04, 2014 12:25 pm
Full name: Colin Jenkins

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Post by op12no2 »

Woo! I have Lozza working in Arena (well in principle anyway).

I was going to spawn a sub-worker with Lozza in it on UCI GO, so I could easily kill it on UCI STOP, but V8 doesn't seem to like a worker starting another one.

NB: Can't currently use Hiarcs UI because it says your exe is 'not a valid engine' - I'll post in the Hiarcs forum to find out what it required for 'validity'.

This is fab Edmund; thank you so much...