avinashkranjan / Amazing-Python-Scripts

🚀 Curated collection of Amazing Python scripts from Basics to Advance with automation task scripts.
https://amazing-python-scripts.avinashranjan.com
MIT License
2.74k stars 1.07k forks source link

[Script]: AI-driven AI Reversi #2516

Closed Shikhar9425 closed 1 year ago

Shikhar9425 commented 1 year ago

Aim

In this game, we'll implement a simple AI that can make moves in the Reversi game using the MiniMax algorithm with alpha-beta pruning.

Details

In this implementation, we create a basic AI for the Reversi game using the MiniMax algorithm with alpha-beta pruning. The AI will try to find the best move by looking ahead three moves into the future. However, you can adjust the depth of the search (variable depth) to increase or decrease the AI's strength. The game continues until there are no valid moves left for both players, and the winner is determined based on the number of discs on the board. The AI (BLACK) will make its move automatically, while the player (WHITE) can input their move row and column when prompted.

Record

Shikhar9425 commented 1 year ago

/assign