Skip to content

Add AI opponent #1

@roh1th-s

Description

@roh1th-s

The game currently only works with 2 human players. Implement an AI opponent to play against.

  • A simple minimax algorithm with alpha-beta pruning may be used for this. Alternatively, interface with an existing chess engine like StockFish through UCI. Make any necessary changes to the data structures currently used to represent the game/board.
  • The AI needs to run on a separate thread so it doesn't interfere with rendering and hang the game. Use mutexes to share data between threads and keep track of whether the AI has finished processing or not. The AI thread may be suspended and resumed whenever necessary.
  • The code to start and stop the AI may be added in the update function in gameplay_state.c. The moves returned by the AI then needs to be made on the board.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions