Skip to content

A computer program that play Vietnam's traditional board game "CO GANH"

Notifications You must be signed in to change notification settings

khanhdq109/Co-Ganh-Solver

Repository files navigation

Co Ganh with simple Searching Algorithms

A computer program that play Vietnam's traditional board game "CO GANH" using Minimax and Monte Carlo Tree Search algorithm.

Project structure

  • main.py : the main code file to execute the program
  • environment.py : environment for bots to play with each other
  • game.py : source code for game "Co Ganh"
  • Minimax.py : source code for Minimax algorithm
  • MCTS.py : source code for Monte Carlo Tree Search algorithm
  • input.txt, output.txt : temporary file to read input and save output in each turn of players

Execute

Human with Bot

Running the program with command line syntax to play with the bot (you can change the algorithm in main.py):

python main.py

When it's your turn, the program will ask you to enter the coordinates.
For example, if you want to move from (4, 4) to (3, 3), type: 4433.

Bot with Bot

Running the program with command line syntax and follow the instructions for bots to play with each other:

python environment.py

There are three algorithms you can choose:

  • minimax (Minimax algorithm)
  • mcts (Monte Carlo Tree Search algorithm)
  • hybrid (combine version of two algorithms above)

Author

Hung Nguyen - Quoc Khanh