user21588: Basically, I’m creating a chess AI and I want to focus on the search algorithm rather than the most complete way or fastest move generation portions. So, for now, I was thinking I could use a prebuilt move generator from a tested and well-known source such as Stockfish.
But I'm having trouble understanding how Stockfish represents the current gamestate and how I can read it, how I can get Stockfish to essentially loop through all of the possible nodes, and how I can check if a given node is a leaf. If someone could point me to a resource or knows how Stockfish does this it would be greatly appreciated.

user23479: It's javascript but chess.js https://github.com/jhlywa/chess.js/ will keep track of board state, load & generate pgns and fens, and tell you what moves are legal.

user12273: For the fastest move generation I suggest the below code.
https://github.com/Mk-Chan/WyldChess/blob/master/src/magicmoves.c
It’s not the Stockfish source code, but I was able to use it for my own hobby engine and I can tell you that it’s very fast. If you have a lot of trouble I can write a post about how I did it.

21588: <p>Basically, I’m creating a chess AI and I want to focus on the search algorithm rather than the most complete way or fastest move generation portions. So, for now, I was thinking I could use a prebuilt move generator from a tested and well-known source such as Stockfish.</p>

<p>But I'm having trouble understanding how Stockfish represents the current gamestate and how I can read it, how I can get Stockfish to essentially loop through all of the possible nodes, and how I can check if a given node is a leaf. If someone could point me to a resource or knows how Stockfish does this it would be greatly appreciated.</p>
 23479: <p>It's javascript but chess.js <a href="https://github.com/jhlywa/chess.js/" rel="nofollow noreferrer">https://github.com/jhlywa/chess.js/</a> will keep track of board state, load &amp; generate pgns and fens, and tell you what moves are legal.</p>
 12273: <p>For the fastest move generation I suggest the below code.</p>

<p><a href="https://github.com/Mk-Chan/WyldChess/blob/master/src/magicmoves.c" rel="nofollow noreferrer">https://github.com/Mk-Chan/WyldChess/blob/master/src/magicmoves.c</a></p>

<p>It’s not the Stockfish source code, but I was able to use it for my own hobby engine and I can tell you that it’s very fast. If you have a lot of trouble I can write a post about how I did it.</p>
