A strategic board game implementation in JavaScript using ES Modules.
Queens Go is a two-player strategy game played on an 8x8 chess-like board. The game combines elements of chess queen movement with territory control mechanics.
- The game is played on an 8x8 chess board
- Two pieces are in play: a Red queen (👑) and a Blue queen (👸)
- Queens move according to chess rules (horizontally, vertically, or diagonally in straight lines)
- Any square that a queen passes through or lands on is colored to match that queen's color
- When a 2x2 square of the same color is formed, those squares are "locked" and can't change color (marked with 🔴 or 🔵)
- If a queen moves across a square of the opponent's color that isn't locked, it changes to the moving queen's color
- Queens can move through locked squares but cannot change their color
# Clone the repository
git clone git@github.com:taypyc/queensGo.git
cd queensGo
# Run the game
node src/index.js- Node.js (v12.0.0 or higher)
queens-go-game/
├── src/
│ ├── components/
│ │ ├── Board.js # Board implementation
│ │ ├── Game.js # Main game logic
│ │ └── Queen.js # Queen piece logic
│ ├── utils/
│ │ └── constants.js # Game constants
│ └── index.js # Main entry point
├── interview_template.js # Template for implementation exercise
├── package.json # Project configuration
└── README.md # This file
The game is currently played by running the demonstration in src/index.js:
node src/index.jsThis will show:
- The initial board state
- Examples of queen movements
- Board state after moves
- Examples of move validation
- Chess-like board with alternating light and dark squares
- Visual representation using emoji icons
- Queen movement validation
- Territory locking mechanism
- Interactive board visualization
You can extend this implementation by:
- Adding a proper turn-based system
- Implementing a scoring mechanism
- Creating a command-line interface for player interaction
- Adding an AI opponent
- Adding a win condition (e.g., most territory after a certain number of turns)
This project uses ES Modules. All files use ES import/export syntax:
// Import
import { BOARD_SIZE, COLORS } from '../utils/constants.js';
// Export
export default Board;ISC License