REPORT
REPORT
Signature
Name
1
DECLARATION
Signature
Name
2
Certificate
This is to certify that student name Ramandeep roll no. 22015041112 developed
the project CHESS GAME. under my guidance and supervision.
3
TABLE OF CONTENTS
S.NO. TITLE PAGE NO.
ABSTRACT v
1.1 INTRODUCTION 1
3.2 SCOPE 3
4. CHAPTER 4: SYSTEM DESIGN AND METHODOLOGY
2. PLAGARISM REPORT 18
3. SOURCE CODE 19
4. PAPER ACCEPTANCE 31
4
LIST OF FIGURES
5
CHAPTER 1 INTRODUCTION
1.1 INTRODUCTION
6
1.2 RESEARCH AND SIGNIFICANCE
7
sector in code development method.
Before developing the tools and therefore the associated
coming up with it's necessary to work out and survey the time
issue, resource demand, man power, economy, and company
strength.
Once these items area unit glad and absolutely surveyed,
then consecutive step is to see concerning the software
package specifications within the individual system like what
form of software system the project would need, and what area
unit all the required software package area unit required to
proceed with consecutive step like developing the tools, and
also the associated operations.
8
3.2 SCOPE
9
CHAPTER 4
1. Windows 10
2. HARDWARE REQUIREMENTS
3. Hard disk of 5 GB
MODULE DESCRIPTION:
1. Signal 0:
This module is used to fetch the game all the time to check
whether the opponent‟s king is been captured or not. If yes,
then game is closed and displays the message like “[winning
player‟s name] win”
CHAPTER 7
CONCLUSION
[3]
SOURCE CODE (HTML)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>Chess Game || Web Mentor</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="game">
<!-- row eight -->
<div class="cellprefix">8</div>
<div class="gamecell" id="1_8"></div>
<div class="gamecell grey" id="2_8"></div>
<div class="gamecell" id="3_8"></div>
<div class="gamecell grey" id="4_8"></div>
<div class="gamecell" id="5_8"></div>
<div class="gamecell grey" id="6_8"></div>
<div class="gamecell" id="7_8"></div>
<div class="gamecell grey" id="8_8"></div>
<!-- row seven -->
<div class="cellprefix">7</div>
<div class="gamecell grey" id="1_7"></div>
<div class="gamecell" id="2_7"></div>
<div class="gamecell grey" id="3_7"></div>
<div class="gamecell" id="4_7"></div>
<div class="gamecell grey" id="5_7"></div>
<div class="gamecell" id="6_7"></div>
<div class="gamecell grey" id="7_7"></div>
<div class="gamecell" id="8_7"></div>
<!-- row six -->
<div class="cellprefix">6</div>
<div class="gamecell" id="1_6"></div>
<div class="gamecell grey" id="2_6"></div>
<div class="gamecell" id="3_6"></div>
<div class="gamecell grey" id="4_6"></div>
<div class="gamecell" id="5_6"></div>
<div class="gamecell grey" id="6_6"></div>
<div class="gamecell" id="7_6"></div>
<div class="gamecell grey" id="8_6"></div>
<!-- row five -->
<div class="cellprefix">5</div>
<div class="gamecell grey" id="1_5"></div>
<div class="gamecell" id="2_5"></div>
<div class="gamecell grey" id="3_5"></div>
<div class="gamecell" id="4_5"></div>
<div class="gamecell grey" id="5_5"></div>
<div class="gamecell" id="6_5"></div>
<div class="gamecell grey" id="7_5"></div>
<div class="gamecell" id="8_5"></div>
<!-- row four -->
<div class="cellprefix">4</div>
<div class="gamecell" id="1_4"></div>
<div class="gamecell grey" id="2_4"></div>
<div class="gamecell" id="3_4"></div>
<div class="gamecell grey" id="4_4"></div>
<div class="gamecell" id="5_4"></div>
<div class="gamecell grey" id="6_4"></div>
<div class="gamecell" id="7_4"></div>
<div class="gamecell grey" id="8_4"></div>
<!-- row three -->
<div class="cellprefix">3</div>
<div class="gamecell grey" id="1_3"></div>
<div class="gamecell" id="2_3"></div>
<div class="gamecell grey" id="3_3"></div>
<div class="gamecell" id="4_3"></div>
<div class="gamecell grey" id="5_3"></div>
<div class="gamecell" id="6_3"></div>
<div class="gamecell grey" id="7_3"></div>
<div class="gamecell" id="8_3"></div>
<!-- row two -->
<div class="cellprefix">2</div>
<div class="gamecell" id="1_2"></div>
<div class="gamecell grey" id="2_2"></div>
<div class="gamecell" id="3_2"></div>
<div class="gamecell grey" id="4_2"></div>
<div class="gamecell" id="5_2"></div>
<div class="gamecell grey" id="6_2"></div>
<div class="gamecell" id="7_2"></div>
<div class="gamecell grey" id="8_2"></div>
<!-- row one -->
<div class="cellprefix">1</div>
<div class="gamecell grey" id="1_1"></div>
<div class="gamecell" id="2_1"></div>
<div class="gamecell grey" id="3_1"></div>
<div class="gamecell" id="4_1"></div>
<div class="gamecell grey" id="5_1"></div>
<div class="gamecell" id="6_1"></div>
<div class="gamecell grey" id="7_1"></div>
<div class="gamecell" id="8_1"></div>
<div class="cellprefix"></div>
<div class="cellprefix">a</div>
<div class="cellprefix">b</div>
<div class="cellprefix">c</div>
<div class="cellprefix">d</div>
<div class="cellprefix">e</div>
<div class="cellprefix">f</div>
<div class="cellprefix">g</div>
<div class="cellprefix">h</div>
<div id="turn">It's White's Turn</div>
</div>
<script
src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jque
ry.min.js'></script>
<script src="script.js"></script>
</body>
</html>
CSS
html,
body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
font-family: sans-serif;
}
div * {
padding: 0;
margin: 0;
box-sizing: border-box;
}
#turn {
max-width: 451px;
max-height: 30px;
width: 100%;
height: 100%;
position: relative;
float: right;
border-radius: 5px;
border: 1px solid rgb(0, 0, 0);
border-style: inset;
text-align: center;
padding: 5px 0 0 0;
background: #fff;
transition: .85s linear;
}
.turnhighlight {
background: #5cb85c !important;
color: #fff;
}
#game {
max-width: 504px;
max-height: 504px;
width: 100%;
height: 100%;
position: relative;
margin: 20px auto;
}
.cellprefix {
width: 100%;
height: 100%;
max-width: 50px;
max-height: 50px;
float: left;
margin: 3px;
padding: 15px 0 0 20px;
}
.gamecell {
border: 1px solid #000;
width: 100%;
height: 100%;
max-width: 50px;
max-height: 50px;
float: left;
margin: 3px;
transition: all 0.5s ease-in-out;
border-radius: 5px;
font-size: 30pt;
padding: 0 0 0 6px;
cursor: pointer;
z-index: 1;
}
.gamecell:hover {
color: #fff;
background: rgba(37, 88, 228, 0.712);
z-index: 2;
transform: translate(10px, -10px);
animation: neonBlueText 1.5s ease-in-out infinite
alternate;
}
.grey {
background: rgba(128, 128, 128, 0.801);
}
.green {
/*background: green !important;*/
background: rgb(65, 161, 73) !important;
}
.neonblue_txt {
animation: neonBlueText 1.5s ease-in-out infinite
alternate;
}
.neonorange_txt {
animation: neonOrangeText 1.5s ease-in-out infinite
alternate;
}
.neongreen_txt {
animation: neonGreenText 1.5s ease-in-out infinite
alternate;
}
/* --- N E O N T E X T --- */
@keyframes neonBlueText {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff,
0 0 40px #228dff,
0 0 70px #228dff, 0 0 80px #228dff, 0 0 100px #228dff,
0 0 150px #228dff;
}
to {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff,
0 0 20px #228dff,
0 0 35px #228dff, 0 0 40px #228dff, 0 0 50px #228dff, 0
0 75px #228dff;
}
}
@keyframes neonOrangeText {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff,
0 0 40px #ff9900,
0 0 70px #ff9900, 0 0 80px #ff9900, 0 0 100px #ff9900,
0 0 150px #ff9900;
}
to {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff,
0 0 20px #ff9900,
0 0 35px #ff9900, 0 0 40px #ff9900, 0 0 50px #ff9900, 0
0 75px #ff9900;
}
}
@keyframes neonGreenText {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff,
0 0 40px #b6ff00,
0 0 70px #b6ff00, 0 0 80px #b6ff00, 0 0 100px #b6ff00,
0 0 150px #b6ff00;
}
to {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff,
0 0 20px #b6ff00,
0 0 35px #b6ff00, 0 0 40px #b6ff00, 0 0 50px #b6ff00, 0
0 75px #b6ff00;
}
}
/* --- N E O N --- */
@keyframes neonBlue {
from {
box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff,
0 0 40px #228dff,
0 0 70px #228dff, 0 0 80px #228dff, 0 0 100px #228dff,
0 0 150px #228dff;
}
to {
box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0
0 20px #228dff,
0 0 35px #228dff, 0 0 40px #228dff, 0 0 50px #228dff, 0
0 75px #228dff;
}
}
/*! * * * * * * * * * * * * * * * * * * * *\
CSShake :: shake-little
v1.5.0
CSS classes to move your DOM
(c) 2015 @elrumordelaluz
http://elrumordelaluz.github.io/csshake/
Licensed under MIT
\* * * * * * * * * * * * * * * * * * * * */
.shake-little {
display: inline-block;
transform-origin: center center; }
.shake-freeze,
.shake-constant.shake-constant--hover:hover,
.shake-trigger:hover .shake-constant.shake-constant--hover {
animation-play-state: paused; }
.shake-freeze:hover,
.shake-trigger:hover .shake-freeze, .shake-little:hover,
.shake-trigger:hover .shake-little {
animation-play-state: running; }
@keyframes shake-little {
2% {
transform: translate(1px, 0px) rotate(0.5deg); }
4% {
transform: translate(1px, 0px) rotate(0.5deg); }
6% {
transform: translate(1px, 1px) rotate(0.5deg); }
8% {
transform: translate(0px, 0px) rotate(0.5deg); }
10% {
transform: translate(1px, 0px) rotate(0.5deg); }
12% {
transform: translate(0px, 0px) rotate(0.5deg); }
14% {
transform: translate(1px, 1px) rotate(0.5deg); }
16% {
transform: translate(0px, 1px) rotate(0.5deg); }
18% {
transform: translate(1px, 0px) rotate(0.5deg); }
20% {
transform: translate(0px, 1px) rotate(0.5deg); }
22% {
transform: translate(0px, 0px) rotate(0.5deg); }
24% {
transform: translate(0px, 0px) rotate(0.5deg); }
26% {
transform: translate(1px, 1px) rotate(0.5deg); }
28% {
transform: translate(0px, 1px) rotate(0.5deg); }
30% {
transform: translate(0px, 0px) rotate(0.5deg); }
32% {
transform: translate(1px, 1px) rotate(0.5deg); }
34% {
transform: translate(0px, 1px) rotate(0.5deg); }
36% {
transform: translate(0px, 1px) rotate(0.5deg); }
38% {
transform: translate(0px, 0px) rotate(0.5deg); }
40% {
transform: translate(1px, 0px) rotate(0.5deg); }
42% {
transform: translate(0px, 1px) rotate(0.5deg); }
44% {
transform: translate(0px, 1px) rotate(0.5deg); }
46% {
transform: translate(0px, 0px) rotate(0.5deg); }
48% {
transform: translate(1px, 0px) rotate(0.5deg); }
50% {
transform: translate(1px, 1px) rotate(0.5deg); }
52% {
transform: translate(0px, 0px) rotate(0.5deg); }
54% {
transform: translate(1px, 1px) rotate(0.5deg); }
56% {
transform: translate(0px, 1px) rotate(0.5deg); }
58% {
transform: translate(1px, 0px) rotate(0.5deg); }
60% {
transform: translate(1px, 1px) rotate(0.5deg); }
62% {
transform: translate(0px, 1px) rotate(0.5deg); }
64% {
transform: translate(0px, 0px) rotate(0.5deg); }
66% {
transform: translate(1px, 0px) rotate(0.5deg); }
68% {
transform: translate(0px, 0px) rotate(0.5deg); }
70% {
transform: translate(1px, 0px) rotate(0.5deg); }
72% {
transform: translate(1px, 1px) rotate(0.5deg); }
74% {
transform: translate(1px, 1px) rotate(0.5deg); }
76% {
transform: translate(0px, 0px) rotate(0.5deg); }
78% {
transform: translate(0px, 0px) rotate(0.5deg); }
80% {
transform: translate(1px, 0px) rotate(0.5deg); }
82% {
transform: translate(1px, 1px) rotate(0.5deg); }
84% {
transform: translate(0px, 1px) rotate(0.5deg); }
86% {
transform: translate(1px, 1px) rotate(0.5deg); }
88% {
transform: translate(1px, 1px) rotate(0.5deg); }
90% {
transform: translate(0px, 1px) rotate(0.5deg); }
92% {
transform: translate(1px, 0px) rotate(0.5deg); }
94% {
transform: translate(1px, 0px) rotate(0.5deg); }
96% {
transform: translate(1px, 0px) rotate(0.5deg); }
98% {
transform: translate(1px, 1px) rotate(0.5deg); }
0%, 100% {
transform: translate(0, 0) rotate(0); } }
.shake-little:hover,
.shake-trigger:hover .shake-little, .shake-little.shake-
freeze, .shake-little.shake-constant {
animation-name: shake-little;
animation-duration: 100ms;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite; }
JAVASCRIPT
let main = {
variables: {
turn: 'w',
selectedpiece: '',
highlighted: [],
pieces: {
w_king: {
position: '5_1',
img: '♔',
captured: false,
moved: false,
type: 'w_king'
},
w_queen: {
position: '4_1',
img: '♕',
captured: false,
moved: false,
type: 'w_queen'
},
w_bishop1: {
position: '3_1',
img: '♗',
captured: false,
moved: false,
type: 'w_bishop'
},
w_bishop2: {
position: '6_1',
img: '♗',
captured: false,
moved: false,
type: 'w_bishop'
},
w_knight1: {
position: '2_1',
img: '♘',
captured: false,
moved: false,
type: 'w_knight'
},
w_knight2: {
position: '7_1',
img: '♘',
captured: false,
moved: false,
type: 'w_knight'
},
w_rook1: {
position: '1_1',
img: '♖',
captured: false,
moved: false,
type: 'w_rook'
},
w_rook2: {
position: '8_1',
img: '♖',
captured: false,
moved: false,
type: 'w_rook'
},
w_pawn1: {
position: '1_2',
img: '♙',
captured: false,
type: 'w_pawn',
moved: false
},
w_pawn2: {
position: '2_2',
img: '♙',
captured: false,
type: 'w_pawn',
moved: false
},
w_pawn3: {
position: '3_2',
img: '♙',
captured: false,
type: 'w_pawn',
moved: false
},
w_pawn4: {
position: '4_2',
img: '♙',
captured: false,
type: 'w_pawn',
moved: false
},
w_pawn5: {
position: '5_2',
img: '♙',
captured: false,
type: 'w_pawn',
moved: false
},
w_pawn6: {
position: '6_2',
img: '♙',
captured: false,
type: 'w_pawn',
moved: false
},
w_pawn7: {
position: '7_2',
img: '♙',
captured: false,
type: 'w_pawn',
moved: false
},
w_pawn8: {
position: '8_2',
img: '♙',
captured: false,
type: 'w_pawn',
moved: false
},
b_king: {
position: '5_8',
img: '♚',
captured: false,
moved: false,
type: 'b_king'
},
b_queen: {
position: '4_8',
img: '♛',
captured: false,
moved: false,
type: 'b_queen'
},
b_bishop1: {
position: '3_8',
img: '♝',
captured: false,
moved: false,
type: 'b_bishop'
},
b_bishop2: {
position: '6_8',
img: '♝',
captured: false,
moved: false,
type: 'b_bishop'
},
b_knight1: {
position: '2_8',
img: '♞',
captured: false,
moved: false,
type: 'b_knight'
},
b_knight2: {
position: '7_8',
img: '♞',
captured: false,
moved: false,
type: 'b_knight'
},
b_rook1: {
position: '1_8',
img: '♜',
captured: false,
moved: false,
type: 'b_rook'
},
b_rook2: {
position: '8_8',
img: '♜',
captured: false,
moved: false,
type: 'b_rook'
},
b_pawn1: {
position: '1_7',
img: '♟',
captured: false,
type: 'b_pawn',
moved: false
},
b_pawn2: {
position: '2_7',
img: '♟',
captured: false,
type: 'b_pawn',
moved: false
},
b_pawn3: {
position: '3_7',
img: '♟',
captured: false,
type: 'b_pawn',
moved: false
},
b_pawn4: {
position: '4_7',
img: '♟',
captured: false,
type: 'b_pawn',
moved: false
},
b_pawn5: {
position: '5_7',
img: '♟',
captured: false,
type: 'b_pawn',
moved: false
},
b_pawn6: {
position: '6_7',
img: '♟',
captured: false,
type: 'b_pawn',
moved: false
},
b_pawn7: {
position: '7_7',
img: '♟',
captured: false,
type: 'b_pawn',
moved: false
},
b_pawn8: {
position: '8_7',
img: '♟',
captured: false,
type: 'b_pawn',
moved: false
}
}
},
methods: {
gamesetup: function() {
$('.gamecell').attr('chess', 'null');
for (let gamepiece in main.variables.pieces) {
$('#' +
main.variables.pieces[gamepiece].position).html(main.variable
s.pieces[gamepiece].img);
$('#' +
main.variables.pieces[gamepiece].position).attr('chess',
gamepiece);
}
},
moveoptions: function(selectedpiece) {
if (main.variables.highlighted.length != 0) {
main.methods.togglehighlight(main.variables.highlighted);
}
switch (main.variables.pieces[selectedpiece].type) {
case 'w_king':
options = (main.methods.options(startpoint,
coordinates,
main.variables.pieces[selectedpiece].type)).slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'b_king':
break;
case 'w_queen':
c1 = main.methods.w_options(position,[{x: 1, y: 1},{x:
2, y: 2},{x: 3, y: 3},{x: 4, y: 4},{x: 5, y: 5},{x: 6, y: 6},
{x: 7, y: 7}]);
c2 = main.methods.w_options(position,[{x: 1, y: -1},
{x: 2, y: -2},{x: 3, y: -3},{x: 4, y: -4},{x: 5, y: -5},{x:
6, y: -6},{x: 7, y: -7}]);
c3 = main.methods.w_options(position,[{x: -1, y: 1},
{x: -2, y: 2},{x: -3, y: 3},{x: -4, y: 4},{x: -5, y: 5},{x: -
6, y: 6},{x: -7, y: 7}]);
c4 = main.methods.w_options(position,[{x: -1, y: -1},
{x: -2, y: -2},{x: -3, y: -3},{x: -4, y: -4},{x: -5, y: -5},
{x: -6, y: -6},{x: -7, y: -7}]);
c5 = main.methods.w_options(position,[{x: 1, y: 0},{x:
2, y: 0},{x: 3, y: 0},{x: 4, y: 0},{x: 5, y: 0},{x: 6, y: 0},
{x: 7, y: 0}]);
c6 = main.methods.w_options(position,[{x: 0, y: 1},{x:
0, y: 2},{x: 0, y: 3},{x: 0, y: 4},{x: 0, y: 5},{x: 0, y: 6},
{x: 0, y: 7}]);
c7 = main.methods.w_options(position,[{x: -1, y: 0},
{x: -2, y: 0},{x: -3, y: 0},{x: -4, y: 0},{x: -5, y: 0},{x: -
6, y: 0},{x: -7, y: 0}]);
c8 = main.methods.w_options(position,[{x: 0, y: -1},
{x: 0, y: -2},{x: 0, y: -3},{x: 0, y: -4},{x: 0, y: -5},{x:
0, y: -6},{x: 0, y: -7}]);
coordinates =
c1.concat(c2).concat(c3).concat(c4).concat(c5).concat(c6).con
cat(c7).concat(c8);
options = coordinates.slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'b_queen':
c1 = main.methods.b_options(position,[{x: 1, y: 1},
{x: 2, y: 2},{x: 3, y: 3},{x: 4, y: 4},{x: 5, y: 5},{x: 6, y:
6},{x: 7, y: 7}]);
c2 = main.methods.b_options(position,[{x: 1, y: -1},
{x: 2, y: -2},{x: 3, y: -3},{x: 4, y: -4},{x: 5, y: -5},{x:
6, y: -6},{x: 7, y: -7}]);
c3 = main.methods.b_options(position,[{x: -1, y: 1},
{x: -2, y: 2},{x: -3, y: 3},{x: -4, y: 4},{x: -5, y: 5},{x: -
6, y: 6},{x: -7, y: 7}]);
c4 = main.methods.b_options(position,[{x: -1, y: -1},
{x: -2, y: -2},{x: -3, y: -3},{x: -4, y: -4},{x: -5, y: -5},
{x: -6, y: -6},{x: -7, y: -7}]);
c5 = main.methods.b_options(position,[{x: 1, y: 0},
{x: 2, y: 0},{x: 3, y: 0},{x: 4, y: 0},{x: 5, y: 0},{x: 6, y:
0},{x: 7, y: 0}]);
c6 = main.methods.b_options(position,[{x: 0, y: 1},
{x: 0, y: 2},{x: 0, y: 3},{x: 0, y: 4},{x: 0, y: 5},{x: 0, y:
6},{x: 0, y: 7}]);
c7 = main.methods.b_options(position,[{x: -1, y: 0},
{x: -2, y: 0},{x: -3, y: 0},{x: -4, y: 0},{x: -5, y: 0},{x: -
6, y: 0},{x: -7, y: 0}]);
c8 = main.methods.b_options(position,[{x: 0, y: -1},
{x: 0, y: -2},{x: 0, y: -3},{x: 0, y: -4},{x: 0, y: -5},{x:
0, y: -6},{x: 0, y: -7}]);
coordinates =
c1.concat(c2).concat(c3).concat(c4).concat(c5).concat(c6).con
cat(c7).concat(c8);
options = coordinates.slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'w_bishop':
c1 = main.methods.w_options(position,[{x: 1, y: 1},{x:
2, y: 2},{x: 3, y: 3},{x: 4, y: 4},{x: 5, y: 5},{x: 6, y: 6},
{x: 7, y: 7}]);
c2 = main.methods.w_options(position,[{x: 1, y: -1},
{x: 2, y: -2},{x: 3, y: -3},{x: 4, y: -4},{x: 5, y: -5},{x:
6, y: -6},{x: 7, y: -7}]);
c3 = main.methods.w_options(position,[{x: -1, y: 1},
{x: -2, y: 2},{x: -3, y: 3},{x: -4, y: 4},{x: -5, y: 5},{x: -
6, y: 6},{x: -7, y: 7}]);
c4 = main.methods.w_options(position,[{x: -1, y: -1},
{x: -2, y: -2},{x: -3, y: -3},{x: -4, y: -4},{x: -5, y: -5},
{x: -6, y: -6},{x: -7, y: -7}]);
coordinates = c1.concat(c2).concat(c3).concat(c4);
options = coordinates.slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'b_bishop':
c1 = main.methods.b_options(position,[{x: 1, y: 1},{x:
2, y: 2},{x: 3, y: 3},{x: 4, y: 4},{x: 5, y: 5},{x: 6, y: 6},
{x: 7, y: 7}]);
c2 = main.methods.b_options(position,[{x: 1, y: -1},
{x: 2, y: -2},{x: 3, y: -3},{x: 4, y: -4},{x: 5, y: -5},{x:
6, y: -6},{x: 7, y: -7}]);
c3 = main.methods.b_options(position,[{x: -1, y: 1},
{x: -2, y: 2},{x: -3, y: 3},{x: -4, y: 4},{x: -5, y: 5},{x: -
6, y: 6},{x: -7, y: 7}]);
c4 = main.methods.b_options(position,[{x: -1, y: -1},
{x: -2, y: -2},{x: -3, y: -3},{x: -4, y: -4},{x: -5, y: -5},
{x: -6, y: -6},{x: -7, y: -7}]);
coordinates = c1.concat(c2).concat(c3).concat(c4);
options = coordinates.slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'w_knight':
options = (main.methods.options(startpoint,
coordinates,
main.variables.pieces[selectedpiece].type)).slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'b_knight':
options = (main.methods.options(startpoint,
coordinates,
main.variables.pieces[selectedpiece].type)).slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'w_rook':
c1 = main.methods.w_options(position,[{x: 1, y: 0},{x:
2, y: 0},{x: 3, y: 0},{x: 4, y: 0},{x: 5, y: 0},{x: 6, y: 0},
{x: 7, y: 0}]);
c2 = main.methods.w_options(position,[{x: 0, y: 1},{x:
0, y: 2},{x: 0, y: 3},{x: 0, y: 4},{x: 0, y: 5},{x: 0, y: 6},
{x: 0, y: 7}]);
c3 = main.methods.w_options(position,[{x: -1, y: 0},
{x: -2, y: 0},{x: -3, y: 0},{x: -4, y: 0},{x: -5, y: 0},{x: -
6, y: 0},{x: -7, y: 0}]);
c4 = main.methods.w_options(position,[{x: 0, y: -1},
{x: 0, y: -2},{x: 0, y: -3},{x: 0, y: -4},{x: 0, y: -5},{x:
0, y: -6},{x: 0, y: -7}]);
coordinates = c1.concat(c2).concat(c3).concat(c4);
options = coordinates.slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'b_rook':
c1 = main.methods.b_options(position,[{x: 1, y: 0},{x:
2, y: 0},{x: 3, y: 0},{x: 4, y: 0},{x: 5, y: 0},{x: 6, y: 0},
{x: 7, y: 0}]);
c2 = main.methods.b_options(position,[{x: 0, y: 1},{x:
0, y: 2},{x: 0, y: 3},{x: 0, y: 4},{x: 0, y: 5},{x: 0, y: 6},
{x: 0, y: 7}]);
c3 = main.methods.b_options(position,[{x: -1, y: 0},
{x: -2, y: 0},{x: -3, y: 0},{x: -4, y: 0},{x: -5, y: 0},{x: -
6, y: 0},{x: -7, y: 0}]);
c4 = main.methods.b_options(position,[{x: 0, y: -1},
{x: 0, y: -2},{x: 0, y: -3},{x: 0, y: -4},{x: 0, y: -5},{x:
0, y: -6},{x: 0, y: -7}]);
coordinates = c1.concat(c2).concat(c3).concat(c4);
options = coordinates.slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'w_pawn':
if (main.variables.pieces[selectedpiece].moved ==
false) {
}
else if (main.variables.pieces[selectedpiece].moved ==
true) {
options = (main.methods.options(startpoint,
coordinates,
main.variables.pieces[selectedpiece].type)).slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
case 'b_pawn':
}
else if (main.variables.pieces[selectedpiece].moved ==
true) {
options = (main.methods.options(startpoint,
coordinates,
main.variables.pieces[selectedpiece].type)).slice(0);
main.variables.highlighted = options.slice(0);
main.methods.togglehighlight(options);
break;
}
},
switch (piecetype) {
case 'w_king':
break;
case 'b_king':
break;
case 'w_knight':
break;
case 'b_knight':
case 'w_pawn':
sp.x = startpoint.split('_')[0];
sp.y = startpoint.split('_')[1];
});
break;
case 'b_pawn':
sp.x = startpoint.split('_')[0];
sp.y = startpoint.split('_')[1];
break;
}
return coordinates;
},
return coordinates;
},
return coordinates;
},
//new cell
$('#' +
target.id).html(main.variables.pieces[selectedpiece.name].img
);
$('#' + target.id).attr('chess',selectedpiece.name);
//old cell
$('#' + selectedpiece.id).html('');
$('#' + selectedpiece.id).attr('chess','null');
//moved piece
main.variables.pieces[selectedpiece.name].position =
target.id;
main.variables.pieces[selectedpiece.name].moved = true;
// captured piece
main.variables.pieces[target.name].captured = true;
/*
// toggle highlighted coordinates
main.methods.togglehighlight(main.variables.highlighted);
main.variables.highlighted.length = 0;
// set the selected piece to '' again
main.variables.selectedpiece = '';
*/
},
// new cell
$('#' +
target.id).html(main.variables.pieces[selectedpiece].img);
$('#' + target.id).attr('chess',selectedpiece);
// old cell
$('#' + main.variables.selectedpiece).html('');
$('#' +
main.variables.selectedpiece).attr('chess','null');
main.variables.pieces[selectedpiece].position =
target.id;
main.variables.pieces[selectedpiece].moved = true;
/*
// toggle highlighted coordinates
main.methods.togglehighlight(main.variables.highlighted);
main.variables.highlighted.length = 0;
// set the selected piece to '' again
main.variables.selectedpiece = '';
*/
},
endturn: function(){
if (main.variables.turn == 'w') {
main.variables.turn = 'b';
main.methods.togglehighlight(main.variables.highlighted);
main.variables.highlighted.length = 0;
// set the selected piece to '' again
main.variables.selectedpiece = '';
$('#turn').addClass('turnhighlight');
window.setTimeout(function(){
$('#turn').removeClass('turnhighlight');
}, 1500);
main.methods.togglehighlight(main.variables.highlighted);
main.variables.highlighted.length = 0;
// set the selected piece to '' again
main.variables.selectedpiece = '';
$('#turn').addClass('turnhighlight');
window.setTimeout(function(){
$('#turn').removeClass('turnhighlight');
}, 1500);
},
togglehighlight: function(options) {
options.forEach(function(element, index, array) {
$('#' + element).toggleClass("green shake-little
neongreen_txt");
});
},
}
};
$(document).ready(function() {
main.methods.gamesetup();
$('.gamecell').click(function(e) {
var selectedpiece = {
name: '',
id: main.variables.selectedpiece
};
if (main.variables.selectedpiece == ''){
selectedpiece.name = $('#' + e.target.id).attr('chess');
} else {
selectedpiece.name = $('#' +
main.variables.selectedpiece).attr('chess');
}
var target = {
name: $(this).attr('chess'),
id: e.target.id
};
if (main.variables.selectedpiece == '' &&
target.name.slice(0,1) == main.variables.turn) { // show
options
// moveoptions
main.variables.selectedpiece = e.target.id;
main.methods.moveoptions($(this).attr('chess'));
main.variables.pieces['w_king'].position = '7_1';
main.variables.pieces['w_king'].moved = true;
$('#'+k_position).html('');
$('#'+k_position).attr('chess','null');
$
('#'+k_target).html(main.variables.pieces['w_king'].img);
$('#'+k_target).attr('chess','w_king');
main.variables.pieces['w_rook2'].position = '6_1';
main.variables.pieces['w_rook2'].moved = true;
$('#'+r_position).html('');
$('#'+r_position).attr('chess','null');
$
('#'+r_target).html(main.variables.pieces['w_rook2'].img);
$('#'+r_target).attr('chess','w_rook2');
main.methods.endturn();
main.variables.pieces['b_rook2'].position = '6_8';
main.variables.pieces['b_rook2'].moved = true;
$('#'+r_position).html('');
$('#'+r_position).attr('chess','null');
$
('#'+r_target).html(main.variables.pieces['b_rook2'].img);
$('#'+r_target).attr('chess','b_rook2');
main.methods.endturn();
// capture
main.methods.capture(target)
main.methods.endturn();
// toggle
main.methods.togglehighlight(main.variables.highlighted);
main.variables.highlighted.length = 0;
main.variables.selectedpiece = target.id;
main.methods.moveoptions(target.name);
});
$('body').contextmenu(function(e) {
e.preventDefault();
});
});
CHESS GAME
RAMANDEEP
development method.
1. INTRODUCTION: Before developing the tool
move. tool.
Once the programmers
begin building the tool the
Fig 2: System
Architecture
Fig 1: Proposed
System Figure 1
ADVANTAGES OF
PROPOSED SYSTEM:
Winner declaration.
4. MODULE DESCRIPTION: made with window size of (512
px,512 px).
Project Modules:
8. Signal 22:
6. Signal 1: This
signal is for
chess piece
whether the
player1 piece
is perfectly
captured the
opponent‟s
king. If it
This interaction of
signal is for any chess
the chess piece in its
piece whether way. If it can
it can move to made the
its destination destination,
with no then signal is
generated 7. Signal 11:
and message
is generated
that it made
a safe move.
board. So that it can move
chess piece in the code and
display over the window.
6. CONCLUSION:
REFERENCES: