Hello everyone, this work is inspired by MicroMax by H.G.Muller.
Play white: https://maksimkorzh.github.io/chess/che ... play=white
Play black: https://maksimkorzh.github.io/chess/che ... play=black
How it works: https://maksimkorzh.github.io/chess/eff ... mming.html
Source code: https://github.com/maksimKorzh/chess/bl ... chess.html
Chess engine with GUI in under ~250 lines of JS code
Moderator: Ras
-
maksimKorzh
- Posts: 785
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Chess engine with GUI in under ~250 lines of JS code
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
towforce
- Posts: 13463
- Joined: Thu Mar 09, 2006 12:57 am
- Location: Birmingham UK
- Full name: Graham Laight
Re: Chess engine with GUI in under ~250 lines of JS code
Very good!
* can the pieces be clearer? Maybe loaded as images?
* I know the idea is to be a tiny program - but it would be lovely to have a way to save the game as a PGN
* can the pieces be clearer? Maybe loaded as images?
* I know the idea is to be a tiny program - but it would be lovely to have a way to save the game as a PGN
Human chess is partly about tactics and strategy, but mostly about memory
-
maksimKorzh
- Posts: 785
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Chess engine with GUI in under ~250 lines of JS code
Thank you, I think this is closer to what you are looking for:
https://github.com/maksimKorzh/wukongJS
https://github.com/maksimKorzh/wukongJS
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
towforce
- Posts: 13463
- Joined: Thu Mar 09, 2006 12:57 am
- Location: Birmingham UK
- Full name: Graham Laight
Re: Chess engine with GUI in under ~250 lines of JS code
Perfect! Direct link: https://maksimkorzh.github.io/wukongJS/wukong.htmlmaksimKorzh wrote: ↑Sat Oct 31, 2026 1:05 am Thank you, I think this is closer to what you are looking for:
https://github.com/maksimKorzh/wukongJS
The first game at the default (max) level ended in an incorrect outcome, so I won't post the pgn here.
Human chess is partly about tactics and strategy, but mostly about memory
-
maksimKorzh
- Posts: 785
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Chess engine with GUI in under ~250 lines of JS code
First, this is the link to a completely different project, not the one the post is about.towforce wrote: ↑Fri Nov 06, 2026 3:39 pmPerfect! Direct link: https://maksimkorzh.github.io/wukongJS/wukong.htmlmaksimKorzh wrote: ↑Sat Oct 31, 2026 1:05 am Thank you, I think this is closer to what you are looking for:
https://github.com/maksimKorzh/wukongJS
The first game at the default (max) level ended in an incorrect outcome, so I won't post the pgn here.![]()
Second, what do you mean by default max level? Default is 1 sec per move, max is 1 min
What do you min by wrong outcome?
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
towforce
- Posts: 13463
- Joined: Thu Mar 09, 2006 12:57 am
- Location: Birmingham UK
- Full name: Graham Laight
Re: Chess engine with GUI in under ~250 lines of JS code
Sorry - I caused confusion by waiting for a week before replying!maksimKorzh wrote: ↑Fri Nov 06, 2026 4:15 pmFirst, this is the link to a completely different project, not the one the post is about.towforce wrote: ↑Fri Nov 06, 2026 3:39 pmPerfect! Direct link: https://maksimkorzh.github.io/wukongJS/wukong.htmlmaksimKorzh wrote: ↑Sat Oct 31, 2026 1:05 am Thank you, I think this is closer to what you are looking for:
https://github.com/maksimKorzh/wukongJS
The first game at the default (max) level ended in an incorrect outcome, so I won't post the pgn here.![]()
Second, what do you mean by default max level? Default is 1 sec per move, max is 1 min
What do you min by wrong outcome?
I reviewed the 250 line engine, you recommend I tried the fully-featured engine, which turned out to be better for me. On that engine, the levels are 1876 Elo (default), 1700 Elo, 1500 Elo and 1000 Elo.
The "wrong outcome" was that the engine won instead of myself. I will fix this unconscionable error by selecting a lower level for the next game!
Human chess is partly about tactics and strategy, but mostly about memory
-
maksimKorzh
- Posts: 785
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Chess engine with GUI in under ~250 lines of JS code
I thought wrong outcome means incorrect pgn data, thank God that's not the case)towforce wrote: ↑Fri Nov 06, 2026 6:28 pmSorry - I caused confusion by waiting for a week before replying!maksimKorzh wrote: ↑Fri Nov 06, 2026 4:15 pmFirst, this is the link to a completely different project, not the one the post is about.towforce wrote: ↑Fri Nov 06, 2026 3:39 pmPerfect! Direct link: https://maksimkorzh.github.io/wukongJS/wukong.htmlmaksimKorzh wrote: ↑Sat Oct 31, 2026 1:05 am Thank you, I think this is closer to what you are looking for:
https://github.com/maksimKorzh/wukongJS
The first game at the default (max) level ended in an incorrect outcome, so I won't post the pgn here.![]()
Second, what do you mean by default max level? Default is 1 sec per move, max is 1 min
What do you min by wrong outcome?
I reviewed the 250 line engine, you recommend I tried the fully-featured engine, which turned out to be better for me. On that engine, the levels are 1876 Elo (default), 1700 Elo, 1500 Elo and 1000 Elo.
The "wrong outcome" was that the engine won instead of myself. I will fix this unconscionable error by selecting a lower level for the next game!![]()
Another engine you liked more, WukongJS, is something I use quite often to play with, mostly as
progressive web application installed to the phone and using mobile version.
This one is not intended as an end user product but as an example of how little code one can use to get a complete engine,
for example first 2 functions of this engine form a complete standalone chessboard library with move validation - just two little
functions instead of tons of code and another little function already can beat a beginner.
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ