Skip to content

BoardMaster utilizes the power of the Minimax algorithm, to simulate the best AI opponents one can face in simple board games.

License

Notifications You must be signed in to change notification settings

SverreNystad/board-master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

board-master

GitHub Workflow Status (with event) GitHub top language GitHub language count License: MIT Project Version

BoardMaster
📋 Table of contents

Introduction

What is BoardMaster?

BoardMaster is a full-stack application designed for players to enjoy various board games against a range of bots, such as RandomMoveAgent, MiniMaxAgent, and others. It offers an immersive gaming experience, combining classic board game fun with modern AI technology.

Main-menu:

BoardMaster

TicTacToe-menu:

BoardMaster BoardMaster

TicTacToe game:

BoardMaster BoardMaster

Minimax Algorithm

The games this algorithm works great for are what game theorists call deterministic , two-player turn-taking, perfect information, zero-sum games. These games are "fully observable", meaning that you can see everything that is going on in the game. They are also "deterministic", meaning that there is no element of chance involved in the game. There is no dice rolling or card drawing. The game is "zero-sum", meaning that one player's gain is the other player's loss. In other words, if you add up all the gains and losses for each player, they will sum to zero. Finally, the game is "turn-taking", meaning that the players alternate making moves, and "perfect information", meaning that no information is hidden from either player. Chess, checkers, tic-tac-toe, Go, and Othello are all examples of deterministic, two-player, turn-taking, perfect information, zero-sum games. However games that has too many possible moves, such as chess, will take too long to compute and will not be feasible to use this algorithm on.

Setup

To setup the project, one needs to have all the prerequisites installed. Clone the repository, install the dependencies and build the project. This is described in more detail below.

Prerequisites

Before setting up BoardMaster, ensure that your system meets the following requirements:

    Ensure that git is installed on your machine. Download Git

Frontend:

    Node.js 16 or higher (Download from Node.js website) BoardMaster requires Node.js to be installed. The project is tested with Node.js 16 and Node.js 20, but it should work fine with any version 16 or higher.

Backend:

For the backend, one can use docker or install the prerequisites manually.

Docker:

Need to have docker installed on your machine. Download Docker

Manual:
    Java JDK 17 or higher (Download from Oracle's website) BoardMaster requires Java JDK to be installed. The project is tested with JDK 17, but it should work fine with any version 17 or higher.
    • Java JDK 17 or higher - Java Development Kit is essential for compiling and running Java applications.
      • Download and install it from Oracle's Java JDK Download Page or adopt an open-source JDK like AdoptOpenJDK.
      • After installation, verify the installation by running java -version and javac -version in your command line or terminal.
    Gradle 8 or higher Gradle is used as the build tool for BoardMaster. It automates the process of building, testing, and deploying the application.
    • Gradle 8 or higher - Gradle brings advanced build toolkit to manage dependencies and other aspects of the build process.
      • You can download Gradle from the Gradle Download Page.
      • Alternatively, if you are using a Gradle Wrapper script (gradlew or gradlew.bat), you do not need to manually install Gradle, as the wrapper script will handle the installation for you.
      • To confirm that Gradle is properly installed, run gradlew -v in your command line or terminal which will display the installed Gradle version.
Ensure that both Java and Gradle are properly installed and configured in your system's PATH environment variable for seamless execution of BoardMaster.

Installation

Follow these steps to set up BoardMaster on your local machine:

1. Clone the repository

git clone https://github.com/SverreNystad/board-master.git

2. Navigate to the Project Directory:

After cloning, move into the BoardMaster project directory:

cd board-master

Frontend

Install node package manager

npm install

Start node package manager:

npm start

After starting the node package manager, the frontend should be available at http://localhost:3000/ and should pop up in your default browser.

Backend

Build the backend with docker:

Note: Remember that cmd uses gradlew and bash uses ./gradlew.

gradlew bootBuildImage --imageName=cogito/boardmaster
Start backend:
docker run -p 8080:8080 -t cogito/boardmaster 

After starting the backend, the backend should be available at http://localhost:8080/

Build the backend manually:

Inside the project directory backend, use Gradle to build the project:

gradlew build

This command compiles the project and downloads all necessary dependencies.

Start backend:

To run the project, run the following command in the root directory of the project:

gradlew bootRun

Tests

Frontend

No tests yet

Backend

To run all the tests, run the following command in the backend directory of the project:

gradlew test

Code Coverage

To generate a code coverage report, use the following Gradle command in backend directory of the project:

gradlew test jacocoTestReport

Documentation

To generate the documentation, use the following Gradle command in backend directory of the project:

gradlew buildClassDiagram

This will create a class-diagram in the docs directory of the project. Open the backend.plantuml file in Plant Uml editor to view the documentation. Alt text

Contributors

Jon Bergland
Jon Bergland

Sverre Nystad

License

Licensed under the MIT License.

About

BoardMaster utilizes the power of the Minimax algorithm, to simulate the best AI opponents one can face in simple board games.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published