Conversation
Added scoring bar, better scoring heuristic and fixes to the makefile on linux
Added better scoring and scoring bar
There was a problem hiding this comment.
Pull request overview
This pull request adds a comprehensive Chess game application with full chess rules implementation, an AI opponent using the minimax algorithm with alpha-beta pruning, and a graphical interface with piece sprites.
Changes:
- Added complete chess game with board representation, move generation, and legal move validation
- Implemented minimax AI with configurable difficulty levels and position evaluation
- Created graphical UI with piece rendering, move indicators, and game state display
Reviewed changes
Copilot reviewed 26 out of 42 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/apps.js | Registers Chess app in the application list |
| apps/Chess/main.c | Main game loop and user interaction handling |
| apps/Chess/ui.c, ui.h | Rendering system for board, pieces, and UI elements |
| apps/Chess/board.c, board.h | Board state management and piece movement |
| apps/Chess/moves.c, moves.h | Legal move generation and check detection |
| apps/Chess/minimax.c, minimax.h | AI opponent with position evaluation |
| apps/Chess/chess_defs.h | Core constants and data structures |
| apps/Chess/sources.mak | Build configuration |
| apps/Chess/img2h.py | Python script to convert PNG images to C headers |
| apps/Chess/icon.png, icon.xcf | Application icon files |
| apps/Chess/assets/*.png, *.h | Chess piece sprites and generated headers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #define VAL_Q 90 | ||
| #define VAL_K 900 | ||
|
|
||
| unsigned int boardConter = 1; |
There was a problem hiding this comment.
The variable 'boardConter' is misspelled. It should be 'boardCounter' for consistency and clarity.
| return 1; | ||
| } | ||
|
|
||
| Move *castelingMove(char board[BOARD_SIZE][BOARD_SIZE], int color, int side, Move *moves) |
There was a problem hiding this comment.
The variable name 'castelingMove' is misspelled. It should be 'castlingMove' (with no 'e' after 'castl').
| except Exception: | ||
| print(f"Error converting {png_file}: {Exception}") |
There was a problem hiding this comment.
The exception variable is being used in the f-string but is not properly referenced. The code should be: print(f"Error converting {png_file}: {e}") with 'e' as the exception variable in the except clause.
| break; | ||
| } | ||
|
|
||
| // Run Minimax avec difficulté variable |
There was a problem hiding this comment.
The comment on line 140 mentions 'Run Minimax avec difficulté variable' which mixes English and French. The comment should be fully in English: 'Run Minimax with variable difficulty'.
| f.write("#include <stdint.h>\n\n") | ||
|
|
||
| # Write pixel data | ||
| f.write("const uint16_t {variable_name}_data[] = {{\n") |
There was a problem hiding this comment.
The f-string is missing the opening 'f' prefix. The line should be: f.write(f"const uint16_t {variable_name}_data[] = {{\n") to properly format the variable name.
Yaya-Cout
left a comment
There was a problem hiding this comment.
LGTM, didn't review in detail as it's an external app, but it runs fine and code seems mostly clean.
This PR adds a Chess game application with: