0% found this document useful (0 votes)
26 views10 pages

Analysis Draft

Uploaded by

mianhuzaer737
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views10 pages

Analysis Draft

Uploaded by

mianhuzaer737
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Analysis

Problem Definition (Broad Aims/Overview)


What is your problem solution intended to do?

I'm i supposed to write about how my chess game will work?

https://www.chesshouse.com/pages/chess-rules

Each player has 16 pieces:

 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:

 The King moves one square in any direction—horizontally,


vertically, or diagonally
 The Rook moves any number of squares horizontally and vertically
along its row or column
 The bishop moves any number of squares diagonally
 The Queen combines the movements of the Rook and Bishop,
moving any number of squares in any direction
 The Knight (not “horse”) jumps in an "L" shape, two squares in one
direction and one square perpendicular
 The Pawn moves one square forward, or two squares from its
starting position, but moves diagonally to capture an opponent’s
piece

The motion of a Rook, Bishop, or Queen stops when it strikes an occupied


square.
There are also a few special manoeuvres where two pieces move at the
same time:
 Capture: When a piece moves to a square occupied by an
opponent's piece, which is then removed from the board.
 Castling: A strategic move where the king and one rook move at
the same time, done to increase the king's safety and the rook's
activity.
 Pawn Promotion: When a pawn reaches the far end of the board,
it is promoted and replaced by a queen, rook, bishop, or knight of
the same colour. If it becomes a queen, the process is referred to as
"queening" the pawn

How does it work on what platform?


Visual Studio provides a robust environment for developing, testing, and
debugging the application. My project is a C# chess game, developed
using the windows as the platform.
You need a windows computer to run the game. The game is designed for
a player vs AI format, where the AI matches the moves of the player. The
game interface displays a digital chessboard where players can click on
pieces to move them. The AI evaluates the player’s moves and mirrors
them to maintain a balanced level of difficulty.

What is the target audience?


Bury college primarily teaches students aged 16-18, studying A-Level
education also offering other courses. A teacher runs a chess club on
Fridays from 12-1 in room V513. However there has been a decrease in
the number of people playing chess as pieces are getting lost,
furthermore college can’t keep spending money on chess sets. Game
could appeal to casual players who want a balanced, fair challenge. The AI
offers a consistent opponent that mirrors the player's skill.

What does it intend to address?


My project aims to solve this problem by providing a digital solution in the
form of a player vs AI chess game. By coding the game in C#, the club
members will no longer have to rely on physical boards and pieces,
ensuring they can play uninterrupted. The AI I am coding will match the
player’s skill level, providing a consistent and balanced opponent for
practice or casual play, allowing the chess club members to enjoy games
without the logistical problems of maintaining physical sets.

Background
Why did you choose this problem?

I chose this problem because of my passion for chess, which I developed


after I started playing the game in late 2022. Since then, I’ve been hooked
by the depth of chess and the fact that there are millions of possible
moves and combinations that can unfold in a single game. This keeps
every match exciting and unique. Through my project, I wanted to bring
my love for chess and problem-solving together by creating a digital chess
experience.
Solving the issue of lost pieces in the chess club while letting others enjoy
the game that has captured my interest felt like the perfect way to merge
my passion with a practical solution.

Research and Investigation


Create a log of research and investigation activities. If online research
conducted, put down the link; if interview conducted, put down whom. For
each method of investigation, summarise it and explain what you have
learned.

Are there any current similar problems?

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.

My solution will aim to make a smooth-running user interface, ensuring no


such visual interruptions occur during AI calculations. Moreover, I plan to
incorporate distinct and clear designs for each chess piece, allowing
players to easily differentiate between them. This will be particularly
important for the chess club audience, where visual clarity is essential.

What are your target audience survey/interview results?

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.

What improvements did those results tell you?


What justifications do you have for your solution?

Research and Investigation

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.

3.Board will be(8X8), there will be rook, bishop, queen,king,pawn,knight,rook, for


both black and white.
4.Pawn only goes up a block at a time, except at the start it has the option to go up 2
blocks.

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.

En passant Castling Pawn promotion


18. Stalemate- when one side has NO legal moves to make. If the king is NOT in
check, but no piece can be moved without putting the king in check, then the game
will end with a stalemate draw.

19. Draw- If a piece hasn’t been captured in the last 50 moves it’s a draw.

20. Ensure that every move the user or AI attempts is legal.

21. Display when the user has been checked.

22. Players alternate turns, starting with white.

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.

27. A screen for playing again or quit the game.

Your solution will be marked on completeness (15 marks max) which is measured by
your objectives.

Modelling (Data and System)


Provide a proposed E-R diagram or/and data flow diagram or any meaningful
diagram on how the different components of the systems work together and how
data will be passed among those components.
 Need to maintain a representation of the game state, such as the position of all
pieces, whose turn it is, and the game outcome.
A loop of the game will alternate between the player’s and AI’s turns until the game
reaches an end condition (checkmate, stalemate, or draw)

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.

Here, the algorithm evaluates the material left on the board.


It calculates the score by assigning values to different pieces (e.g., pawns
= 1, knights = 3, bishops = 3, rooks = 5, queen = 9).

It outlines a basic evaluation function, which would work as part of the AI


decision-making process in your game. I could implement this with
deeper search algorithms, as well as implement move generation to
complete your player vs AI game logic.

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

You might also like