Sim is a two-player game. Each player will take turns coloring any uncolored lines in the play area. The first player to create a triangle loses the match.
Live Demo
![Sim gameplay, players taking turns placing lines](/daniel-citrus/Sim/raw/main/readmefiles/playing.gif)
All three corners (ie. vertices) of the triangle must be on the outer edge of the diagram.
![]() |
![]() |
![]() |
![]() |
Table of Contents
This project aims to demonstrate the use of factory functions, complex algorithms, data structures, and encapsulation. The Computer opponent uses the Min-max algorithm with alpha-beta pruning to make smart decisions. The level of skill in these decisions vary depending on the selected difficulty.
To setup this project locally you must have Node Package Manager (npm) installed.
- npm
npm install npm@latest -g
- Clone the repo
git clone https://github.com/daniel-citrus/Sim.git
- Install NPM packages
npm install
- Game board
- Tracks each line
- Check for losing triangles
- Add new moves (including player number)
- Reset the board
- Provide available moves
- Bot
- Random move
- Move that does not result in a loss
- Efficient move
- Game Director
- Track current player
- Controls front-end module
- Controls game board
- Controls bot
- Front-end module for UI operations
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/daniel-citrus/Sim