Analysis Draft
Analysis Draft
https://www.chesshouse.com/pages/chess-rules
1 King
1 Queen
2 Rooks
2 Bishops
2 Knights
8 Pawns
A game of chess ends when the King on either side is captured, which is
called a checkmate. Checkmate occurs when the player's king is in a
position to be captured ("in check") and there is no legal move that the
player can make to escape the check.
A game can also end by Fifty-move rule: A draw can be claimed if during
the last fifty consecutive moves by each player, no pawn has been moved
and no capture has been made; this rule prevents games from continuing
indefinitely with no real action.
Resignation: A player may concede defeat at any point during the game, usually when
they believe that loss is inevitable.
Movement of pieces:
Background
Why did you choose this problem?
https://toytheater.com/chess/# https://playpager.com/easy-chess/
Both links are the for the same game
In researching existing chess games, one example encountered was a user interface that
presents some issues. A notable issue is the screen occasionally displaying three dots
during the AI's move, followed by a blackout. This brief pause can distract and frustrate
players, breaking their focus and disrupting the flow of the game. Additionally, the
visual design of the pieces poses a challenge; the bishop and pawn resemble each other,
which can cause confusion, making the player do a blunder.
Despite these issues, there are some advantages of this game design. The game features
a simple and clean user interface, which helps players navigate the board. The timer
system and the display of the AI's move duration also add to the overall experience,
increasing engagement by introducing a time management element.
Q1: What are the problems with the current system of chess games?
A1: Players will arrive during Fridays during 12-1 in room V513, they will be given a
chess board and pieces. However, there may be some chess sets that have a piece
missing e.g. pawn, and not enough playing time.
Analysis response: Toluwani has indicated that there is a difficulty with the current
system when it comes to spending time setting up the board, as they only have 1 hour to
play, this time could be used to play the game. A difficulty with not having the proper
number of pieces to set up the board (32, 16 per side).
Q2: Do you believe that a digital version of chess on a computer could be a solution to
issues you are facing with the current system?
A2: I strongly agree, notably with issues of missing pieces and the process of setting up
the board could be easily solved with a digital program.
Analysis response: Solomon has clarified the importance of a program and has indicated
that a program would solve the 2 biggest issues with the current system.
Q3: Are there any essential features you would like to see in the finished system?
A3: There's a move to draw the game , called 50 move rule where the game draws if no
pieces are captured, this would be great as when we play chess in the current system we
don't know when the 50 moves happened, and some players keep on playing past the
50 moves breaking the rules. Furthermore, during the game, it would be helpful if you
could be able to flip the board to see the perspective of black or white depending on if
they chose black or white at the start, as you get a sense of your opponent’s plans.
Analysis response:
Key Objective: Implement a 50-move rule into my digital game.
Key Objective: Flip the board, press on a button called flip and it will flip the board,
while preserving the move.
Objectives
Give a list of specific and measurable objectives to reach a full solution.
BE VERY SPECIFIC!
1.Game must load with a main menu, showing buttons to start a game
between player vs AI.
2.Board will have cells where each piece will a memory location.
5.Knight moves two squares vertically and one square horizontally, or two squares
horizontally and one square vertically (with both forming the shape of a capital L)
6.Queen- move 1-7 squares in any direction, up, down, left, right.
7.Bishop moves diagonally only. The black bishop must only move diagonally in the
black squares and white bishop must only move in the white squares.
8.Rook moves horizontally, vertically, can move in any square. Can castle with King.
9.King, can castle, can be checked but can be blocked by a piece or move
to a safe block to get away from the check. Can move 1 block at a time
anywhere, (left, right up, down, diagonally). King must be checkmated to win the
game (King can’t move anywhere else to avoid the check).
10. Use recursive algorithms to implement the Minimax algorithm with Alpha-Beta
pruning, enabling the AI to search deeper into future moves while optimising
performance.
11. Create a complex Object-Oriented Programming (OOP) design using classes for
each chess piece, the chessboard, and the AI logic.
12. Implement a simple version of a relational database that tracks basic player
statistics, such as wins, losses, and draw across games.
13. At the end of the game, it will output the respective users records of moves in the
database.
14. Use binary search to efficiently validate moves from a pre-defined list of legal
moves for each chess piece.
15. Implement polymorphism and inheritance, define a base class called Chess
Piece that contains shared attributes and methods common to all pieces (e.g.,
position, colour, and move validation).
16. Each specific chess piece (like Pawn, Rook, Bishop) will inherit from this base
class and implement its own unique movement logic.
17. Implement specific chess rules like castling, pawn promotion, and en passant.
19. Draw- If a piece hasn’t been captured in the last 50 moves it’s a draw.
23. Use an indicator for the player to see what their available moves are.
24. Able to flip the board to see the perspective of black or white depending on if
they chose black or white at the start.
25.The player can press a button called Resign, and the AI will win.
26.A screen at the end if you have been checkmated, have checkmated the
opponent, or stalemate by 50 move rules.
Your solution will be marked on completeness (15 marks max) which is measured by
your objectives.
Turn Management
The control of turns will be alternated between the player and the AI.
If it's the player's turn, they will input a move, and the board will update
accordingly.
After that, the AI will make its move based on the same board state
Once moves are made, the game will check if the move results in
checkmate, stalemate, or a draw.
Data for the game result can be updated in the GameState class.
Represents a basic evaluation function for determining the status of a chess game in
terms of material evaluation, checkmate, stalemate, and whose turn it is.
If it's Black's turn, return +9999 (Black wins).
If it's White's turn, return -9999 (White wins).
Stalemate/insufficient material: If the game is a draw due to stalemate or
insufficient material (e.g., king vs king), return 0, indicating a neutral
evaluation.
Else: If neither checkmate or stalemate, proceed to material evaluation.
Data Flow:
Board Sate: The current state of the chessboard, which includes the
positions of all the pieces.
Game status: Information about whether the game is over
(checkmate, stalemate) or still ongoing.
Player Turn: Whether it is White's turn or Black's turn.
Evaluated score: The material score and/or positional advantage of
a given board state