I developed an Othello game using Python. Anyone can play easily
github page https://github.com/chihina/othello-game-python
python3.7.1 For others, check requirement.txt on the following github page. https://github.com/chihina/othello-game-python
First, do a git clone with the following command.
git clone https://github.com/chihina/othello-game-python.git
Next, install the libraries in bulk with the following command.
pip -r install requirement.txt
This is the end of environment construction. It's easy. The game starts with the following command. Please play it !!
python game.py
We have implemented the following three battle modes. --Human vs Human --Human vs CPU --CPU vs CPU (computer vs computer)
In the top two modes, you can choose first or second.
The computer has implemented three strengths. --Weak (weak) --Little strong --Strong
The following describes how to implement the computer.
Randomly decide which move to take from the available moves. In short, I'm choosing a hand for texto.
In Othello, it is said that taking four corners is strong (generally). In other words, if you do not hit your own frame in the red frame of the image below, you will not be taken against the four corners. Therefore, I implemented it so as not to hit my own frame in the red frame of the image below.
Use the static evaluation value of Othello obtained from the following website. https://uguisu.skr.jp/othello/5-1.html
Use this static evaluation value to determine the move.
The simulation results of the three CPUs are shown below.
You can see that the winning percentage comes out in the order of strength. You can see how important corners are in Othello.
We've only implemented a simple CPU here. Possible future possibilities include determining the hand by reading a few moves and determining the hand using machine learning. If you have any advice, I would appreciate it if you could comment !!
github page https://github.com/chihina/othello-game-python
References How to make Othello (reversi) (algorithm) -Evaluation by stone position- (2020/3/13 access) https://uguisu.skr.jp/othello/5-1.html
Recommended Posts