Check out example codes for "chess perft 5". It will help you in understanding the concepts better.

Code Example 1

r3k2r/pp1pp1pp/8/2pPPp/2P2P2/1P4P1/P6P/R3K2R w k f6 0 1 5

Learn ReactJs, React Native from akashmittal.com