-
Notifications
You must be signed in to change notification settings - Fork 26
Added Chess #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Chess #38
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name 'castelingMove' is misspelled. It should be 'castlingMove' (with no 'e' after 'castl').
| except Exception: | ||
| print(f"Error converting {png_file}: {Exception}") |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: