The video tutorial series is now completed.
I'd like to thank all of you guys for being interested in my work!
Here're the step-by-step tutorials:
Defining board class, initializing game rules:
Implementing move generator:
Implementing make/unmake moves:
Implementing evaluation:
Implementing search:
Implementing CLI interface (+ playing vs engine!):
Special thanks to Gerd Isenberg for adding Toyfish to my CPW page!
https://www.chessprogramming.org/Maksim_Korzh
Toyfish: chess engine in Python for absolute beginners
Moderators: hgm, Rebel, chrisw
-
- Posts: 771
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Toyfish: chess engine in Python for absolute beginners
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
-
- Posts: 771
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Toyfish: chess engine in Python for absolute beginners
Wow! Awesome! Now this is exactly what I've been asking for! Thank you Mr. Muller!hgm wrote: ↑Tue Jul 20, 2021 1:43 pm It is certainly possible to implement recursion 'by hand'. I.e. making an iterative search, rather than a recursive one. In languages that do not support recursion (such as Fortran) you had to do that anyway. The trick is just to keep everything that would be a local variable as an array element indexed by the ply level. To mimic the recursive call you just increment 'ply', and jump back to the beginning of the code that normally is in Search(). To mimic a return you decrement 'ply', and jump to just behind where a normal return should go (i.e. just behind the mimicked call). Except when ply == 0 (the root), where you just continue with the main loop (which would print and execute the move).
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
-
- Posts: 771
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Toyfish: chess engine in Python for absolute beginners
Here's a minified version of stockfish, significantly stripped down:
I've encode piece move offsets into integers representing chess piece on board,
so no more need to source chess rules data from "settings.json" file
Source code:
https://github.com/maksimKorzh/toyfish/ ... yfish-mini
I've encode piece move offsets into integers representing chess piece on board,
so no more need to source chess rules data from "settings.json" file
Source code:
https://github.com/maksimKorzh/toyfish/ ... yfish-mini
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