You are on page 1of 4

PROBLEM STATEMENT two factors: simplicity and aesthetic being

top priorities. It aims to provide the same


Real, authentic experience of playing a
experience of over the board chess on the
game of chess with a friend has been
online medium. All it requires is an
deemed a rarity in the post covid era. This
internet connection and a friend to play
web application is an attempt to bring the
with.
same experience of competitiveness and
This web application offers a well
friendly banter online in just two simple
designed game setup with instructional
clicks.
notations and guides throughout the
game along with a real time chat window
OBJECTIVE for friendly banters.
Every algorithm used in the game is
Chess has been around for as long as
original. Algorithms dictating the legal
1500 years. What usually was considered
moves for every piece as well as deciding
as an elitist activity now sees the
the ending of the game when a person is
households of millions across the globe as
check mated, has been written from
a fun but tense board game. The
scratch.
popularity of the game is now at an all
time high, thanks to the pandemic which
motivated people to resort to nostalgic Features
activities and also to the mega popular
netflix series Queen’s Gambit. Due to Game rooms
lockdowns, most of the chess world has
shifted realm to the online space which Every user has the option of either
has given birth to a whole new era for the creating a room or joining an existing
game of tactics and strategy. room. Each room accommodates only two
This project intends to bring the beautiful players that go up against each other as
game of chess a little closer and to make white and black. The user that creates the
the process a little simpler by providing room is assigned the colour white in the
an online platform for people to play game leaving the user joining the room as
chess with their friends in just two clicks black. Creating a room generates a special
and also be able to chat with them code that is displayed on the screen. The
through means of text in real time. other user can join the room by entering
the same code and the game starts
INTRODUCTION instantly. Rooms are created using the
The following project is a web application javascript’s socket.io library that enables
that is hosted online in the public domain. real-time, bidirectional and event-based
Users can link up with their friends and communication between the browser and
enjoy the game of chess even from distant the server.
places in the world. It is designed with
Chat window An audible sound is produced whenever a
legal move is made on the board.
Alongside gameplay, this web application
also offers a separate chat window to Check,Checkmate,Castle,etc
communicate with the other player in real
time. Each chat window is linked to the Structures & Algorithms
same room that is assigned to the
respective game using socket.io library
Board
which keeps the conversation accessible
to the only players inside that room.
Players can communicate through means
of text and emoticons.

In-Game Features

Individual perception
The board is aligned accordingly to each
player’s perception(facing white/black)
and both sides’ moves are made following
different perceptions but the same square
notations.

Multiple themes
The game board is built using css grid
Users can decide the theme colour of the
(display:grid) and each square on the
board among the selections of three
board is assigned a colour(dark/light),
colour combinations.
file(column) and rank(row) using css
class and id. Each square is then
Captured piece display board
identifiable by a unique combination of
Both the user’s and the opponent’s
rank and file.
captured pieces are displayed in a
separate board for convenience in
keeping track of the game.

Legal moves display


Upon clicking on a piece, all the legal
moves for that piece is displayed on the
board for better visualisation of the game.

Move sound
Knight

¿
(column=¿ c +1∨¿ column=¿ c−1)¿∨¿
¿
(row =¿ r+ 1∨¿ row=¿ r −1)¿

King

¿ row−r∨¿ 1∧¿∨column−c≤1∨¿

Pawn
Pieces
Pieces are png images contained within a
separate div carrying the identity of that
piece using id’s. First move :
Following are the algorithms for the legal column−c≤2∧¿ row=¿ r
moves of each piece currently at the Rest :
square with row r and column c: column=¿ c +1∧¿ row=¿ r

Rook There are supplementary algorithms for


features such as move count (keeps track
of the number of moves made by each
piece), captures (only be able to capture
row=¿ r∨¿ column=¿ c opponent’s pieces), piece blockade (if a
legal square is blocked by your own
Bishop piece), check (if the king is or will be in
check), castle (requires the rook and the
king not been moved and the passage
squares not covered by any of the
¿ row−r∨¿=¿ column−c∨¿ opponent’s pieces), etc

Queen
USE STACK
Languages
● Javascript- For frontend as well as
(row =¿ r∨¿ column=¿ c) backend. Javascript has been used
¿
for writing the game logic and also
for displaying the game live as it handling, CSS animation, and Ajax.
progresses. All the algorithms have It is used for many features in the
been written in javascript. game such as prompting a function
Javascript is used to attach the upon certain clicks, assigning
html page to the backend and different attributes to html
receive and send commands in real elements and retrieving an
time. element of certain attributes.
● HTML- HTML has been used for
laying out the basic structure of HARDWARE AND
the entire game including the
board, pieces as well as the chat SOFTWARE
box. REQUIREMENTS
● CSS- All of the designs (colour,
shape, size, position, etc) of each
and every element in the ● PROCESSOR- Ideal requirement is
application has been done using of a processor running at above 2
CSS(Cascading Style Sheets). GHz frequency

● MEMORY- RAM should be of 2GB


Languages
or higher. The hard disk must be
● Express.js- Express.js or simply
4GB or higher.
Express is a back end web
application framework for Node.js.
● NETWORK- LAN or any other
It is designed for building web
network must be established and
applications and APIs.
the machines must be having LAN
card in order to run the
Libraries application
● Socket.io- Socket.io is a javascript
library. It enables real time, bi-
directional communication b/w
web clients and servers. It is used
in this application for creating and
classifying rooms for separate
games as well as facilitating
communication between players
through the chat window.
● jQuery- jQuery is a JavaScript
library designed to simplify HTML
DOM tree traversal and
manipulation, as well as event

You might also like