A web-based implementation of the m,n,k game, where two players take turns placing their markers on an m×n board, with the goal of getting k markers in a row (horizontally, vertically, or diagonally).
An m,n,k game is an abstract board game with the following parameters:
- m: Number of rows on the board
- n: Number of columns on the board
- k: Number of markers in a row needed to win
Some popular examples of m,n,k games include:
- Tic-tac-toe: 3,3,3 game (3×3 board, need 3 in a row to win)
- Gomoku: 15,15,5 game (15×15 board, need 5 in a row to win)
- Connect Four: 6,7,4 game (6×7 board, need 4 in a row to win)
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository
git clone https://github.com/maxliu42/mnk-game.git
cd mnk-game
- Install dependencies
npm install
- Start the development server
npm start
- Open your browser and navigate to
http://localhost:3000
- Configure the game parameters (m, n, k) or select a preset
- Click "Start Game" to begin
- Players take turns clicking on the board to place their markers
- The first player to get k markers in a row (horizontally, vertically, or diagonally) wins
- If the board fills up without a winner, the game ends in a draw
- React - Frontend library
- TypeScript - Type-safe JavaScript
- Vite - Frontend build tool
This project is licensed under the MIT License.