Skip to content

A deployable, full-stack website to play the board game TicTacTrains against online opponents or an artificially intelligent agent

Notifications You must be signed in to change notification settings

fdfea/tictactrains

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TicTacTrains

Table of Contents

  1. Summary
  2. Modules
  3. Tech Stack
  4. Game Rules
  5. Credits

Summary

A deployable, full-stack website to play the board game TicTacTrains against online opponents or an artificially intelligent agent.

Try out the game here! (It might take a minute or two to load.)

Modules

  • Client – A React front-end which allows the user to interact with the board and configure game settings.
  • Server – An Express/Colyseus server to matchmake and manage games between online opponents.
  • Engine – An implementation of the game rules and the AI opponent in C.

Tech Stack

The demo website is hosted on Heroku. The front-end of the website was built using React. Routing is handled with React Router and the user interface was supplemented with React Bootstrap. The website is served from an Express server. The networking and game state management for online games was simplified with Colyseus. Additionally, the web application made use of the Node and NPM development environments and the JavaScript and TypeScript programming languages. The game engine and AI was implemented with the C programming language, and then compiled to WebAssembly using Emscripten to run in a web browser. The machine learning for the AI was implemented with the Python programming language, using the scikit-learn library for modeling, and the pandas library for data manipulation. A more detailed explanation of the AI is available in the engine.

Game Rules

TicTacTrains is an abstract strategy game that has been likened to a combination of the popular pencil-and-paper games Tic-Tac-Toe and Dots and Boxes.

Two players take turns placing pieces on a 7x7 board until all the squares are filled. The first player's pieces are X's and the second player's pieces are O's. The goal is to create a longer train of pieces than your opponent, connected horizontally and vertically, but not diagonally. If both players' longest train is the same length, the game ends in a draw. Once a player places a piece on a square, that piece is locked for the remainder of the game, and a piece cannot be placed on a square that is already occupied. The rules can be modified by way of the order of the players' turns and the squares available to move on. For a more detailed explanation of the game mechanics and rules, see the engine.

Credits

Developer and Creator - Forrest Feaser (@fdfea)

About

A deployable, full-stack website to play the board game TicTacTrains against online opponents or an artificially intelligent agent

Resources

Stars

Watchers

Forks