Coder Social home page Coder Social logo

dimitrijekaranfilovic / quoridor Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 2.0 2.3 MB

Bots for the board game quoridor implemented using four algorithms: minimax, minimax with alpha beta pruning, expectimax and monte carlo tree search.

License: GNU General Public License v3.0

Python 100.00%
minimax-algorithm minimax-alpha-beta-pruning minimax expectimax monte-carlo-tree-search monte-carlo quoridor quoridor-game bot quoridor-bot

quoridor's Introduction

quoridor

Description

You can read the rules of the game here.

This project contains bots for the game quoridor written in four different ways:

  • minimax
  • minimax with alpha-beta pruning
  • expectimax
  • monte carlo tree search

Running the project

It is recommended that you run this project from a virtual environment.

In order to run the project, you need to have numpy installed. After you've done that, open the terminal and position yourself in the project root directory, and simply run python main.py.

Instructions

Note: All commands are case-insensitive.

When you start the program, you will encounter the following:

picture

Here, you can choose whether you want to play against a bot or you want to watch two bots play against each other (which I do not recommend).

If you choose to play against a bot, you only choose one algorithm

picture

If, however, you choose a simulation, you need to choose algorithms for both bots:

picture

After that, you can play the game. The board looks like this:

picture

If you chose a simulation, you cannot enter any moves, you can just sit and watch. If you chose to play, you will control the player one (green P1). Each turn, you can either:

  • move your piece or
  • place a wall.

Moving the piece

If you want to move your piece, simply enter mx,y, where x represents the row and y represents the column of the field you want to move to. The rows and columns where you can move your piece are white.

Placing the wall

If you want to place the wall, simply enter wx,yd, where x represents the row and y the column of the walls starting piece. The d represents the direction:

  • if you want a vertical wall, the direction can be either s(south) or n(north)
  • if you want a horizontal wall, the direction can be either e(east) or w(west)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.