1
- # ♔ JS Chess Engine
1
+ # ♕ JS Chess Engine
2
2
3
3
> ** A pure JavaScript chess engine inspired by the legendary Atari Video Chess, designed to outplay the original through superior AI and modern web technologies.**
4
4
@@ -22,19 +22,16 @@ In 1979, Atari released Video Chess for the Atari 2600 - a groundbreaking achiev
22
22
### What Problem Does This Solve?
23
23
24
24
** For Chess Enthusiasts:**
25
-
26
25
- Provides a pure JavaScript chess implementation that runs entirely in the browser
27
26
- Offers an AI opponent with adjustable difficulty levels
28
27
- Enables chess learning through position analysis and move suggestions
29
28
30
29
** For Developers:**
31
-
32
30
- Demonstrates advanced JavaScript patterns including ES2022 private fields
33
31
- Showcases modular architecture with clean separation of concerns
34
32
- Provides a comprehensive testing framework for complex game logic
35
33
36
34
** For AI Researchers:**
37
-
38
35
- Implements classic game AI algorithms (Minimax with Alpha-Beta pruning)
39
36
- Offers a platform for experimenting with chess evaluation functions
40
37
- Enables comparison with historical chess engines
@@ -106,7 +103,6 @@ Before you begin, ensure you have the following installed:
106
103
Navigate to ` http://localhost:8080` to see the chess engine in action.
107
104
108
105
# ### Development Commands
109
-
110
106
` ` ` bash
111
107
# Development server
112
108
npm start # Start live development server on port 8080
@@ -128,26 +124,25 @@ npm run security-fix # Fix security vulnerabilities
128
124
` ` `
129
125
130
126
# ### Project Structure
131
-
132
127
```
133
128
js-chess-engine/
134
129
├── src/
135
- │ ├── core/ # Chess logic foundation
130
+ │ ├── core/ # Chess logic foundation
136
131
│ │ ├── Board.js # Board representation and state
137
132
│ │ ├── Piece.js # Piece definitions and validation
138
133
│ │ ├── GameState.js # Game state management
139
134
│ │ ├── MoveGenerator.js # Move generation algorithms
140
135
│ │ └── ...
141
- │ ├── ui/ # User interface components
136
+ │ ├── ui/ # User interface components
142
137
│ │ ├── BoardRenderer.js # Visual board rendering
143
138
│ │ ├── InputHandler.js # User input processing
144
139
│ │ └── styles.css # Styling and themes
145
- │ ├── ai/ # AI engine (future implementation)
146
- │ └── utils/ # Shared utilities
140
+ │ ├── ai/ # AI engine (future implementation)
141
+ │ └── utils/ # Shared utilities
147
142
│ └── Constants.js # Game constants and piece values
148
- ├── tests/ # Test files
149
- ├── index.html # Main HTML entry point
150
- └── package.json # Project configuration
143
+ ├── tests/ # Test files
144
+ ├── index.html # Main HTML entry point
145
+ └── package.json # Project configuration
151
146
```
152
147
153
148
#### Quick Start Guide
@@ -165,7 +160,6 @@ Our development follows a structured, phase-based approach with clear milestones
165
160
### **Phase 1: Documentation & Project Management** ✅ **COMPLETED**
166
161
167
162
_Timeline: June 2025_
168
-
169
163
- ✅ **Professional README.md** ([#35](https://github.com/jane-alesi/js-chess-engine/issues/35)) - Impactful header and project description
170
164
- ✅ **Installation & Usage Guide** ([#36](https://github.com/jane-alesi/js-chess-engine/issues/36)) - Comprehensive setup instructions
171
165
- ✅ **Architecture Documentation** ([#37](https://github.com/jane-alesi/js-chess-engine/issues/37)) - Mermaid diagrams and contribution guidelines
@@ -175,56 +169,52 @@ _Timeline: June 2025_
175
169
176
170
---
177
171
178
- ### **Phase 2: Core Move Generation** 🔄 **IN PROGRESS **
172
+ ### **Phase 2: Core Move Generation** ✅ **COMPLETED **
179
173
180
174
_Timeline: July-August 2025 | Priority: HIGH_
181
-
182
175
- ✅ **Pawn Move Generation** ([#4](https://github.com/jane-alesi/js-chess-engine/issues/4)) - Forward, double, and capture moves
183
176
- ✅ **Rook Move Generation** ([#2](https://github.com/jane-alesi/js-chess-engine/issues/2)) - Horizontal and vertical movement patterns
184
177
- ✅ **Bishop Move Generation** ([#1](https://github.com/jane-alesi/js-chess-engine/issues/1)) - Diagonal movement patterns
185
178
- ✅ **Knight Move Generation** ([#9](https://github.com/jane-alesi/js-chess-engine/issues/9)) - L-shaped movement patterns
186
179
- ✅ **King Move Generation** ([#7](https://github.com/jane-alesi/js-chess-engine/issues/7)) - Single-square movement patterns
187
- - 📅 **Queen Move Generation** ([#6](https://github.com/jane-alesi/js-chess-engine/issues/6)) - Combined rook and bishop patterns
180
+ - ✅ **Queen Move Generation** ([#6](https://github.com/jane-alesi/js-chess-engine/issues/6)) - Combined rook and bishop patterns
188
181
189
- **Current Status**: ✅ Pawn, Rook, Bishop, Knight, and King moves fully implemented with comprehensive testing
190
- **Next Priority**: Queen move generation (the final piece for this phase).
182
+ **Current Status**: ✅ All pseudo-legal move generation for standard pieces is now implemented.
191
183
192
184
---
193
185
194
- ### **Phase 3: Core Game Logic** 📅 **PLANNED**
186
+ ### **Phase 3: Core Game Logic** 🗓️ **PLANNED**
195
187
196
188
_Timeline: September-October 2025 | Priority: MEDIUM_
197
-
198
- - 📅 **Enhanced Move Validation** - Self-check prevention and legal move filtering
199
- - 📅 **Check Detection** - King threat analysis and validation
200
- - 📅 **Checkmate & Stalemate** - Game ending condition detection
201
- - 📅 **Special Moves Implementation**:
189
+ - 🗓️ **Enhanced Move Validation** - Self-check prevention and legal move filtering
190
+ - 🗓️ **Check Detection** - King threat analysis and validation
191
+ - 🗓️ **Checkmate & Stalemate** - Game ending condition detection
192
+ - 🗓️ **Special Moves Implementation**:
202
193
- Castling (kingside and queenside)
203
194
- En passant capture
204
195
- Pawn promotion
205
- - 📅 **Game Flow Orchestration** ([#14](https://github.com/jane-alesi/js-chess-engine/issues/14)) - Complete game state management
196
+ - 🗓️ **Game Flow Orchestration** ([#14](https://github.com/jane-alesi/js-chess-engine/issues/14)) - Complete game state management
206
197
207
198
**Dependencies**: Requires completion of Phase 2 (all piece move generation).
208
199
209
200
---
210
201
211
- ### **Phase 4: AI Implementation** 📅 **PLANNED**
202
+ ### **Phase 4: AI Implementation** 🗓️ **PLANNED**
212
203
213
204
_Timeline: November 2025-January 2026 | Priority: MEDIUM_
214
-
215
- - 📅 **Basic AI Foundation**:
205
+ - 🗓️ **Basic AI Foundation**:
216
206
- Random move selection
217
207
- Legal move filtering
218
208
- Basic position evaluation
219
- - 📅 **Minimax Algorithm**:
209
+ - 🗓️ **Minimax Algorithm**:
220
210
- Recursive game tree search
221
211
- Alpha-Beta pruning optimization
222
212
- Configurable search depth
223
- - 📅 **Position Evaluation**:
213
+ - 🗓️ **Position Evaluation**:
224
214
- Material value calculation
225
215
- Positional factors (center control, piece development)
226
216
- King safety assessment
227
- - 📅 **Difficulty Levels**:
217
+ - 🗓️ **Difficulty Levels**:
228
218
- Beginner (depth 1-2)
229
219
- Intermediate (depth 3-4)
230
220
- Advanced (depth 5-6)
@@ -234,43 +224,41 @@ _Timeline: November 2025-January 2026 | Priority: MEDIUM_
234
224
235
225
---
236
226
237
- ### **Phase 5: User Interface & Experience** 📅 **FUTURE**
227
+ ### **Phase 5: User Interface & Experience** 🗓️ **FUTURE**
238
228
239
229
_Timeline: February-March 2026 | Priority: LOW_
240
-
241
- - 📅 **Interactive Board Enhancements**:
230
+ - 🗓️ **Interactive Board Enhancements**:
242
231
- Drag-and-drop piece movement
243
232
- Move highlighting and validation
244
233
- Animated piece transitions
245
- - 📅 **Game Features**:
234
+ - 🗓️ **Game Features**:
246
235
- Move history and notation
247
236
- Position analysis tools
248
237
- Save/load game functionality
249
- - 📅 **Visual Improvements**:
238
+ - 🗓️ **Visual Improvements**:
250
239
- Multiple board themes
251
240
- Piece set customization
252
241
- Responsive design for mobile
253
- - 📅 **Accessibility**:
242
+ - 🗓️ **Accessibility**:
254
243
- Keyboard navigation
255
244
- Screen reader support
256
245
- High contrast modes
257
246
258
247
---
259
248
260
- ### **Phase 6: Performance & Advanced Features** 📅 **FUTURE**
249
+ ### **Phase 6: Performance & Advanced Features** 🗓️ **FUTURE**
261
250
262
251
_Timeline: April-June 2026 | Priority: LOW_
263
-
264
- - 📅 **Performance Optimizations**:
252
+ - 🗓️ **Performance Optimizations**:
265
253
- Web Workers for AI computation
266
254
- Transposition tables for position caching
267
255
- Move ordering improvements
268
256
- Bitboard representation (optional)
269
- - 📅 **Advanced AI Features**:
257
+ - 🗓️ **Advanced AI Features**:
270
258
- Opening book integration
271
259
- Endgame tablebase support
272
260
- Neural network evaluation (experimental)
273
- - 📅 **Additional Features**:
261
+ - 🗓️ **Additional Features**:
274
262
- Multiplayer support
275
263
- Tournament modes
276
264
- Chess variant support (Chess960, King of the Hill)
@@ -280,14 +268,14 @@ _Timeline: April-June 2026 | Priority: LOW_
280
268
281
269
### **Progress Tracking**
282
270
283
- | Phase | Completion | Key Milestones | Target Date |
284
- | ----------- | ---------- | --------------------------------------------------------------------- | ------------ |
285
- | **Phase 1** | ✅ 100% | Professional documentation complete | ✅ June 2025 |
286
- | **Phase 2** | 🔄 90 % | Pawn, Rook, Bishop, Knight, King moves implemented, 1 piece remaining | August 2025 |
287
- | **Phase 3** | 📅 0% | Awaiting Phase 2 completion | October 2025 |
288
- | **Phase 4** | 📅 0% | Awaiting Phase 3 completion | January 2026 |
289
- | **Phase 5** | 📅 0% | UI/UX enhancements | March 2026 |
290
- | **Phase 6** | 📅 0% | Performance & advanced features | June 2026 |
271
+ | Phase | Completion | Key Milestones | Target Date |
272
+ |-------------| ------------| -----------------------------------------------------------------------------| --------------- |
273
+ | **Phase 1** | ✅ 100% | Professional documentation complete | ✅ June 2025 |
274
+ | **Phase 2** | ✅ 100 % | All pseudo-legal moves for standard pieces implemented | ✅ August 2025 |
275
+ | **Phase 3** | 🗓️ 0% | Awaiting Phase 2 completion | October 2025 |
276
+ | **Phase 4** | 🗓️ 0% | Awaiting Phase 3 completion | January 2026 |
277
+ | **Phase 5** | 🗓️ 0% | UI/UX enhancements | March 2026 |
278
+ | **Phase 6** | 🗓️ 0% | Performance & advanced features | June 2026 |
291
279
292
280
### **Success Metrics**
293
281
@@ -299,32 +287,7 @@ _Timeline: April-June 2026 | Priority: LOW_
299
287
300
288
---
301
289
302
- ## 🏛️ Current Status
303
-
304
- This project is actively under development with a focus on:
305
- ✅ **Core Foundation Complete**
306
-
307
- - Board representation and piece management
308
- - Move generation for pawns (with comprehensive testing)
309
- - Game state tracking and validation
310
- - Modern ES2022 implementation with private fields
311
-
312
- 🔄 **In Progress**
313
-
314
- - Move generation for all remaining pieces (Rook, Bishop, Knight, King, Queen)
315
- - Advanced game rules (castling, en passant, promotion)
316
- - Check and checkmate detection
317
-
318
- 📖 **Coming Next**
319
-
320
- - AI opponent with multiple difficulty levels
321
- - Position evaluation and strategic play
322
- - Interactive web interface
323
- - Performance optimizations
324
-
325
- ---
326
-
327
- ## 🏗️ Architecture
290
+ ## 🏛️ Architecture
328
291
329
292
The engine follows a modular design inspired by classic chess programming principles, with clear separation of concerns and unidirectional data flow:
330
293
@@ -344,7 +307,7 @@ flowchart TD
344
307
BOOK[Opening Book]
345
308
end
346
309
347
- subgraph "♔ Core Chess Logic"
310
+ subgraph "♟️ Core Chess Logic"
348
311
CORE[Core Module]
349
312
BOARD[Board]
350
313
PIECE[Piece]
@@ -376,7 +339,7 @@ flowchart TD
376
339
### Architecture Principles
377
340
378
341
- ** Layered Design** - Clear separation between UI, AI, Core Logic, and Utilities
379
- - ** Unidirectional Data Flow** - Data flows from UI/AI → Core → Utils
342
+ - ** Unidirectional Data Flow** - Data flows from UI/AI ⇒ Core ⇒ Utils
380
343
- ** Modular Independence** - Each module can be developed and tested independently
381
344
- ** Future Extensibility** - Architecture supports advanced AI features and UI enhancements
382
345
@@ -414,4 +377,4 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE)
414
377
415
378
** Project Link:** [ https://github.com/jane-alesi/js-chess-engine ] ( https://github.com/jane-alesi/js-chess-engine )
416
379
417
- _ Built with ♔ by the chess programming community_
380
+ _ Built with ♕ by the chess programming community_
0 commit comments