Skip to content

myapos/tic-tac-toe

Repository files navigation

tic-tac-toe

This tic-tac-toe version was built with Vue 3 in Vite.

Game Details - Instructions

Note: This is an advanced version of Tic-tac-toe. This assignment was published in Greatfrontend platform.

Tic-tac-toe is a game for two players who take turns making space in a three-by-three grid with X or O. The player who succeeds in playing three of their marks in a horizontal, vertical, or diagonal row is the winner. Source: Wikipedia

Traditionally, tic-tac-toe uses a 3 x 3 grid. In this problem, an advanced version of a tic-tac-toe game is built where the grid has N x N cells on the board and needs M marks in a horizontal, vertical, or diagonal row to win. The following diagram shows an example game where N = {{ N }} and M = {{ M }}.

You can change these parameters by adding to the URL parameters ?N=4&M=3 where N >= M. Try it!

Player modes

Three player modes are supported:

  • Single player mode (1P) where a human player plays against an AI player. For this mode there are two available selections where the user can select between minimax and negamax algorithms.
  • Two players mode (2P) where two human players can play against other.
  • Auto mode (Auto) where two AI players can play against other.

Recommended IDE Setup

VSCode + Volar (and disable Vetur).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need Volar to make the TypeScript language service aware of .vue types.

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

Run Unit Tests with Vitest

npm run test:unit

Lint with ESLint

npm run lint

NodeJS version

node > 18+

About

This repo contains an implementation of tic tac toe game with Vue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published