Chess Board Opengl Project
Chess Board Opengl Project
INTRODUCTION
Project Overview:
The aim of the program is to come up with a game of chess .The program also
includes pieces of chess, board and the frame.
The game of chess is the game where two players are involved one takes pieces
that are white and another that are black.
It consisting of different snap shorts have been taken to future explain how the class
program works. Firstly the programmer had started to look at the pieces of chess and then
chess board, thereafter a chess board together with pieces
The pictures are of the pieces of chess are called as:
Piece
Number 1
Symbols
The chess board has been drawn by using rectangles, ellipses, and also 2-dimension
java classes. Set color method has also been used which enables us to change the appearance
of the board has we Would have to wanted . After looking at the board then we looked at the
final board that contains pieces.
SYSTEM ANALYSIS
Existing System:
In the opinion of the inventor, free and open discussion between team members and
collective decision making process may make the game spectacular by increasing its
dynamism and presenting the various stages of chess players' thinking, evaluation of
positions, calculation of variants, choice of alternatives, and so on. In turn, in order to ensure
active team discussion and effective decision making process the Interactive Cognitive
Scenario was developed
Contents:
Key Ideas Branch: version of a chess game having own rating, that is played on one demonstration
chessboard .
Branch rating: a number indicating how important the branch, which is a marks (colored
chips), located in the upper part of the demonstration chessboard. The score of each branch is
equal to its chess result, multiplied by the rating of the given branch.
Branching: splitting a branch of a single move by splitting one of the existing branches
(the "parent") into two and distributing the ratings between the two child" branches.
Different moves will subsequently be made in each branch. This can only be done if there is a
free demonstration chessboard.
Selection: removing a branch in a single move in recognition of defeat from a position on
that branch, and redistribution of its branch rating between those of its remaining siblings.
The opponent team gets points equal to the lost branch rating.
Passing: transferring one unit (colored chip) in a single move from one branch rating to a
sibling, with no gain nor loss of points.
Description:
The board, pieces, their positions and rules of movement are the same as for standard
chess. But several parallel branches (versions of the same game) can be played at the
same time on the several boards, with the help of rating (importance) indicators of a
Demonstration boards :
A business chess game tree with chess passing . The rectangles denote branches (1
to 5) and their respective ratings (1 to 10)
Only one member of the team may move pieces and ratings on the demonstration board
Game parameters: The time allowed for thinking over the moves and the form of time control. There is a
huge number of possible ways the Interactive Cognitive Scenario can be realized. Therefore,
before a game is played some parameters should be agreed:
The number of players in each team and the rules for their replacement during the game
Tournaments have been held regularly since 1997. ] Running commentary of one of them
Wider aspects: Apart from being a sport, Business Chess can also be used for scientific modeling of
mental activity, the processes of problem solving and a choice of strategy, as a general
educational business game.
Proposed System:
The first system, and the one that may be thought of as the simplest in concept, is just an
8 x 8 matrix that can hold one value per square: 0 if there the square is empty, 1 if
there is a white pawn, 2 if there is a white knight, -1 if there is a black pawn, etc.
This concept is really quite easy, because it just requires a matrix and some constants.
However, it can become difficult to compute the possible moves on the board, because the
computer must check the bounds and the locations of the pieces over and over. So, the
program will cycle through the board perhaps 20-30 times per turn.
Another representation method tries to help the computation of moves by combining the
The 8 x 8 matrix of the board is then centered with a2 row border around it. This ensures
that all knight moves lie within the matrix, no matter where the knight starts from. Next,
B.V.C. Institute of Technology & Science
undesignated pieces) and thus, the moves into the border by any piece would be illegal.
This method tries to integrate the move generator and the bounds checker by creating a
raised "rim" around the board, ensuring that any move trying to get out will be blocked by
the "rim."
By far one of the most innovative representations is the bit board. Say you have a 64-bit
integer. Now, that's interesting...there are also 64 squares on a chess board...quite a
coincidence.
Some programmers also recognized this coincidence, and they quickly caught on to how
of the possible moves for Black's knights computed and recorded on a bit board.
Then, to decide which moves are blocked by Black's own pieces, you take a bit board of
all of Black's pieces, take the complement (the N OT operator) and then AND it to your
Feasibility Study:chess has undergone a few changes. One of the biggest changes in chess is the switch
from classical openings to style referred to as hypermodern openings. Before you can
B.V.C. Institute of Technology & Science
SOFTWARE
REQUIREMENTS
SPECIFICATION
This software will be used by PMO to check current status of the client projects.
Health of projects that are executed under the Non-Telecom Business Unit of Infinite
Computer Solutions are regularly monitored and measured quantitatively and the
consolidated health is reported to the TSG Head on a fortnightly basis.
10
Intended Audience and Reading Suggestions:The intended audience of this SRS is PMO (Project Manager Officer), project
managers, developers, testers, and documentation writers .This SRS contains product
functions, external interface requirements, functional requirements and non-functional
requirements. The section System features mentioned in this SRS is useful for
Developers and Non-functional requirement will be useful for testers.
11
HARDWARE
&
SOFTWARE
REQUIREMENTS
Hardware Specifications:Processor
Intel processor IV
RAM
128 MB
Hard disk
- 20 GB
Pen drive
- Kingston
4GB
B.V.C. Institute
of Technology
& Science
12
19 inch LCD
108 mercury keyboard
Microsoft mouse
- windows XP/2000
- JDK1.50-0.5
13
SYSTEM
DESIGN
Design:-
14
Module Design:It has a board data where every field is represented with a row . There are
interface functions like move- piece and clear-board and set /get complete board/field.
The board integrates internal business logic. Like checking if a certain move is legal
are removing pieces, and it is only used once, because two boards at the same time are
useless.
I want this chess board in a file/module/class. While this is a good job for a class,
there might be other ways in python. What is the one way .
a. Instance of a class inside a file/module.
b. Class without instance approach.
c. Pure module approach.
15
Given
chessboard
and specific
rank
and file
we'll
locate
exactly 1
square.
UML specification provides no lucid explanation of what multiplicity 1 means for qualifier.
Implementation:I am trying to decide how best to implement threads into my java chess program. The
program is pretty good as far as it goes, but right now it is just a single threaded app. When I
make a move, a command is issued to repaint the board. At the same time, the chess engine
(computer brain) starts churning, to calculate the next move.
ways to do implement a thread, have my engine class extend Thread or implement Runnable.
It is my under -standing that the only real difference between the two is that implementing
runnable is preferable because of flexibility, it won't prevent you from extending another
class if you need to. In any event, I don't really have any concerns with how to do either at
this point.
System Architecture:
Large systems are always decomposed into subsystem that provides some related set of
services. The initial design process of identifying these sub-systems and establish a
framework for the subsystem control and communication is called the Architectural Design.
System architecture is the conceptual design that defines the structure and behavior of
system. It specifies the set of relations between the part of system. It is formal description of
B.V.C. Institute of Technology & Science
16
User Interface Layer: This is the layer where user interacts with the system.
Business Logic Layer: the business logic is implemented in this layer.
Data Access Layer: All the calls to the stored procedures are made from here.
17
The pieces are different colors, so that you can easily tell which pieces belong to
which side.
The pieces are different shapes, so that you can easily tell which pieces are of which
type.
The squares are arranged in rows and columns, so that you can easily see, for
example, which squares this rook can move to.
The squares are different colors, so that you can easily see which squares each bishop
can move to.
What I'm trying to get at is: there's a lot of information packed into a chess board, but it
doesn't get overwhelming. When I look at the board, if I ask myself, "Where are the kings?"
my brain instantly picks them out. If I ask myself, "Where can this bishop move to?" my
brain instantly focuses on those particular diagonals. If I ask myself, "Where can this rook
move to?" I instantly see that, too - the differently-colored squares (which help me with the
bishop) don't distract me when I'm thinking about the rook. My brain just... focuses on the
right thing.
18
CODING
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
public
class
ChessGameDemo
MouseMotionListener
{
JLayeredPane layeredPane;
JPanel chessBoard;
JLabel chessPiece;
int xAdjustment;
extends
JFrame
implements
19
MouseListener,
20
21
22
23
24
TESTING
Introduction
Software testing is an investigation conducted to provide stakeholders with information about
the quality of the product or service under test. Software testing also provides an objective,
independent view of the software to allow the business to appreciate and understand the risks
at implementation of the software.
Software testing can also be started as the process of validating and verifying that a
software program/application/product:
1. Meets the business and technical requirements that guided its design and
development.
2. works as expected; and
3. Can be implemented with the same characteristics.
25
Testing Levels
Unit Testing:
Unit testing refers to tests that verify the functionality of a specific section of code, usually at
the function level. In an object-oriented environment, this is usually at the class level, and the
minimal unit tests include the constructors and destructors. These type of tests are usually
written by developers as they work on code (white-box style), to ensure that the specific
function is working as expected. One function might have multiple tests, to catch corner cases
or other branches in the code. Unit testing alone cannot verify the functionality of a piece of
software, but rather is used to assure that the building blocks the software uses work
independently of each other. Unit testing is also called component testing.
Unit tool is used to carry out the unit testing for the project.
Source Code Testing
This examines the logic of the system. If we are getting the output that is required by
the user, then we can say that the logic is perfect.
Specification Testing
We can set with, what program should do and how it should perform under various
conditions. This testing is a comparative study of evolution of system performance and
system requirements.
Module Level Testing
In this type of testing, the error will be found at each individual module, it encourages
the programmer to find and rectify the errors without affecting the other modules.
Unit Testing
Unit testing focuses on verifying the effort on the smallest unit of software-module.
The local data structure is examined to ensure that the data stored temporarily maintains its
integrity during all steps in the algorithms execution. Boundary conditions are tested to
B.V.C. Institute of Technology & Science
26
Security Testing
Security testing attempts to verify that protection mechanism built into system will in
fact protect it from improper penetration. The tester may attempt to acquire password through
external clerical means, may attack the system with custom software design to break down
any defenses to others, and may purposely cause errors.
Performance Testing
Performance Testing is used to test runtime performance of software within the
context of an integrated system. Performance test are often coupled with stress testing and
require both software instrumentation.
Black Box Testing
Black- box testing focuses on functional requirement of software. It enables to derive
set of input conditions that will fully exercise all functional requirements for a program.
Black box testing attempts to find error in the following category:
27
Interface errors.
Errors in data structures or external database access and performance errors.
White Box Testing
White Box Testing is a testing in which in which the software tester has knowledge
of the inner workings, structure and language of the software, or at least its purpose. It is
purpose. It is used to test areas that cannot be reached from a black box level
28
SCREEN
LAYOUTS
29
30
31
FUTURE
SCOPE
32
Completeness:
The applet implements the complete set of chess rules, including en passant (EP)
capture, pawn promotion, castling, draw by stalemate, draw by repetition, draw by lack of
progress, and optional time control.
Functionality:
The chess applet is easy to use with mouse clicks to designate moves, sound and
color to prompt the user or give feedback as appropriate, automatic generation of an
algebraic notation game listing, and it allows users to change sides.
Server Features:
The chess data server allows the user to save and restore games. Applet-computed
moves are stored at the server for future use resulting in faster response and optimal
playing strength.
Development:
The applet is written with strict object oriented (OO) discipline for easier
development and maintenance.
Performance:
On fast hardware, the applet will challenge the average chess player and will
occasionally beat the expert player. Playing strength will be improved by running the
chess applet on faster hardware: it adjusts its look-ahead depth to fit your machines
power.
33
Square, a location (rank and file) with some state data for en passant capture and pawn
promotion.
Chess Piece, a representation of a piece with material value, location (Square), state data,
a Vector of Squares (legal moves) and legal move generation functions.
Chess Board, an array of Chess Pieces with some state variables and pieces movement
functions.
Game Node, a node in the chess game tree that has a Chess Board to represent a point in
the chess configuration space, a Chess Board to represent the best move, and a Vector of
Game Nodes to represent the next available moves.
Chess, the applet itself, which has a Chess Board and a chess game tree represented by a
root Game Node.
34
Startup sound ("Shall we play a game?" from War Games), a long sound.
Alternate startup sound ("Would you like to play a game of chess? I play very well."
HAL 9000 computer from 2001 Space Odyssey), a long sound.
Reset sound. ("Wouldn't you rather play a game of chess?" from War Games), a long
sound.
Client-Server Memory Version 3.00 introduces client-server memory. Each time the computer is to move, it
will first query the server move database to see if that position is on record. If so, the
recommended move is returned along with the search depth that move was computed with. If
the current applet instance is using an equal or shallower search depth, the server move will
be used. If the current applet is searching deeper, the applet will compute the move. Moves
computed by the applet are sent to the server for storage for future use. Using client-server
memory makes the applet respond faster for cases when the move is found on the server. The
client-server memory can make the applet play stronger by using stored moves computed on
faster hardware.
35
The applet does not enforce "touch move." Official chess rules require that a player
move the first piece he touches (except for piece adjustment, which does not apply
here).
The applet does not allow the taking back of moves (and neither do the rules of
chess).
Some browsers will re-initialize the applet when returning to the page. To prevent the
loss of game data, save your game before leaving the page.
The applet does not think during the human's turn to move.
In the timed game mode, upon notification of game loss, the players are allowed to
continue play.
36
CONCLUSION
37
38
BIBILOGRAPHY
39
40