Have a go hero – Connecting a UCI-compliant chess engine

If you really want to test your skills, you can implement a ChessAlgorithm subclass that will connect to a Universal Chess Interface (UCI) chess engine such as StockFish (http://stockfishchess.org) and provide a challenging artificial intelligence opponent for a human player. UCI is the de facto standard for communication between a chess engine and a chess frontend. Its specification is freely available, so you can study it on your own. To talk to a UCI-compliant engine, you can use QProcess, which will spawn the engine as an external process and attach itself to its standard input and standard output. Then, you can send commands to the engine by writing to its standard input and read ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.