I am reading an opening book in King's Gambit, and been writing down the lines to study later. But I wish there was a chess engine, that goes for those lines so I can play against them. I want to play the book lines against the engine so I don't forget them later. And the engine responds with the book lines back. Do you have any suggestions on how to make such a bot? For example a bot that looks up the favored variations and plays them otherwise plays a Stock-fish's best move.

2 Answers 2


Chess engines use an opening book during the opening. The standard way of doing what you ask is to build your own opening book and point the chess engine to that so it uses your book and not the previously supplied one.

When you are done just switch back.


Just set up the position you're interested in using Forsyth–Edwards Notation and feed it to the engine. For example if you want the engine to play the Muzio Gambit, give it this FEN: rnbqkbnr/pppp1p1p/8/8/2B1Ppp1/5N2/PPPP2PP/RNBQ1RK1 b kq - 1 5

Which corresponds to this position with Black to play:

rnbqkbnr/pppp1p1p/8/8/2B1Ppp1/5N2/PPPP2PP/RNBQ1RK1 b kq - 1 5
  • 1
    No I meant exercising the book moves that brings to this position.
    – eguneys
    Jan 4, 2021 at 5:43
  • Give it an opening book then?
    – Allure
    Jan 4, 2021 at 5:54
  • Can you extend your answer to provide an opening book for kings gambit, and the way to use it. Also I want to specify the moves myself first copied from the book I am reading, and let the engine play them.
    – eguneys
    Jan 4, 2021 at 6:11
  • How can I possibly know what opening lines you want the engine to play? You're the one who does; you must make the opening book.
    – Allure
    Jan 4, 2021 at 6:12
  • 1
    chess.stackexchange.com/questions/5933/… Although you will almost certainly find it easier to just set up the position you're interested in.
    – Allure
    Jan 4, 2021 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.