New course! Every coder should learn Generative AI!
Try a free lesson+ 1
There was a chess bot competition here once.
If you browse the Code Playground for 'chess', you should be able to find a lot of examples you can study.
(It's not a simple task, and certainly not one you can answer in a little q&a thread.)