Академический Документы
Профессиональный Документы
Культура Документы
A Dissertation submitted to
Jawaharlal Nehru Technological University, Hyderabad
In partial fulfillment of the requirements for the award of the degree of
BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE AND ENGINEERING
By
D.SRIKANTH REDDY
(11N31A0549)
CERTIFICATE
Mr.M.VAZRALU
Mr.M.SAIDI REDDY
HOD (CSE)
(Internal guide)
EXTERNAL EXAMINER
INDEX
TITLE
PAGENO
Title page
College certificate
Declaration.................................................................... i
Acknowledgement.......................................................... ii
Abstract......................................................................... iii
1. INTRODUCTION ...
1
2. GAME OVERVIEW ... 2
2.1 GAME DESCRIPTION
2.1.1 Environment
4. SOURCE CODE
5. RESULTS ..
6. CONCLUSION
DECLARATION
9
15
18
D.SRIKANTH REDDY
ACKNOWLEDGEMENT
Computer Science and Engineering Department, Malla Reddy College of Engineering and
Technology for his encouragement, support and guidance in carrying out the project.
We wish to convey our sincere thanks to Dr.V.S.K. Reddy (principal) Malla Reddy
College of Engineering and Technology and Prof. M. SAIDI REDDY(HOD- Malla Reddy
College of Engineering and Technology) and other teaching and non-teaching staff who directly
or indirectly contributed their assistance in finishing out this project successfully.
We take pride in forwarding the gratitude and wishes to our parents and friends who have
given us moral support and helped us in successful completion of our project.
D.SRIKANTH REDDY
ii
ABSTRACT
The goal of our project is to design a concentration game which works on any
Browser which is JAVA SCRIPT ENABLED. For our Project, we decided to design a game,
where the objective of the game is to identify the identical numbers which are embedded in the
blocks within the specific time. The game is designed in HTML.As a result, we have created a
game that is fun and helps in scope of increasing memory power.
iii
1. INTRODUCTION
Pairs, also known as Concentration, Memory cards, Pexeso etc. are a simple
card game, where player must find two identical cards. This game is great for memory
training and good to kill some time for kids and adults. Concentration is a card game in
which all of the cards are laid face down on a surface and two cards are flipped face up
over each turn. The object of the game is to turn over pairs of matching cards.
Concentration can be played with any number of players or as solitaire and is an
especially good game for young children, though adults may find it challenging and
stimulating as well. The scheme is often used in quiz shows and can be employed as
an educational game.Nevertheless.Our goal is to show developers how to create an easy
game like this with only a few lines of code for many mobile operation systems.
2. GAME OVERVIEW
NotePad++
2
Browser:
All supported browsers should be installed. Current trend is that browsers tend to
support standards and implementations converge, although there are differences.
You need at least: Firefox, Chrome and Internet Explorer.
Each turn, one card are flipped over. After turning two cards, if the cards do not
match, they are both turned back face down. If the cards match, they are left face up and the
person who made the match receives a point.
With a regular deck of cards, the pair is considered the card with the same color and number (so
the ace of hearts matches the ace of diamonds).
Concentration can be played with regular playing cards or with special themed cards. It can be
played by 1, 2, 3 or 4 people. More than 4 people can be divided into teams.
It's a terrific game for young children to play and can be done with educational sets of cards
(flash cards and the like). The winner is the person with the most pairs, and there may be a tie for
first place.
tool bar with only two buttons (close and new game) and timer. Main part of our application is a
grid with twenty four cards. The cards are uncovering with a nice 2D effect.
Many of these may be played in combination with one another:
Any Color: A version especially good for young children where matching pairs need
only be of the same rank, not the same color. When playing with jokers, these count double
because they are more difficult to match.
One Flip: Players who make a successful pair win these cards but do not go again until
their next turn.
Zebra: Pairs may only be formed by cards of the same rank, but opposite in color (so 7
of diamonds would match with a 7 of clubs or spades, but not a 7 of hearts)
Two Decks: For a much longer game, shuffle together two 52-card decks and lay them
out in 8 rows of 13 cards (9 rows of 12 cards if using jokers). Pairs must be identical (same
rank and same suit, so the 10 of clubs would have to match the other 10 of clubs).
Two Decks Duel: Duel is a two-player game where the playing field is divided into two
separate parts. Each player shuffle a full 52-card deck and lay it out in 4 rows of 13 cards.
The players cannot access each other's cards. Player one starts, flipping one card face-up,
then player two selects one card from his/her own side. If the pair is a match, cards are
removed, if not, they are flipped back. Pairs must be identical (same rank and same suit, so
the 10 of clubs would have to match the other 10 of clubs). After every turn roles are
exchanged, in this case: player two flips a card and player one answers.
Double Decker Checkerboard: For a slightly easier version of the two-pack game, use
decks with different backs and shuffle them separately. Deal them out in a
checkerboard pattern (red, blue, red, blue, etc.) The different backs help identify the position
in the grid and significantly reduce the possibility of which cards will match.
Fancy: The cards need not be laid out in a strict rectangular grid and many players have
their own special layouts that include circular, triangular, or diamond-shaped formations.
Dealers may select any layout they wish.
Concentration is not limited to playing cards. Many versions of the game that are
designed for children may have different themes. In some computer versions, the cards may
randomly move to increase the difficulty.
Figure 1
Figure 2
6
3. GAME DESIGN
The game is a 2D view in general. The objects used in this game 4x4 square
boxes and digits from 1 to 12.
Figure 3
The player has given a time limit, with in that time limit the player needs to finish the
game. if player fails to match the pairs then he will be given an option of exit and restart. Initially
the player needs to select a block, there certain number will be displayed and the number will be
vanished. Likewise player needs to select another blocks. The player has to remember the
position of the numbers. Then player needs to form a pair of similar numbers. If player provides
correct input then the similar numbers will be displayed, Likewise player needs to search the pair
of similar numbers with in the given time limit.
7
3.1.1. GAME SCENE
The game scene is made of only one scene in our game. This scene has two layers,
first which creates all cards and second which shows time.
Figure 4
4. SOURCE CODE
STYLE.CSS
/* CSS Document */
#memory_board{
background:GREEN;
border: green 1px solid;
width:800px;
height:540px;
padding:24px;
margin:0px auto;
}
#memory_board > div{
background:url(../images/checkerd.jpg) no-repeat;
border:1px solid #000;
width:71px;height:71px;float:left;
margin:10px;
9
padding:20px;
font-size:64px;
cursor:pointer;
text-align:center;
}
MEMORYBOARD.JS
// JavaScript Document
Array.prototype.memory_tile_shuffle = function()
{
var i = this.length, j, temp;
while(--i > 0)
{
j = Math.floor(Math.random() * (i+1));
temp = this[j];this[j] = this[i];
10
this[i] = temp;
}
}
function countdown_timer(){
// decrease timer
max_time--;
document.getElementById('countdown').innerHTML = max_time;
if(max_time == 0)
{
alert("TIME UP Game Over");
clearInterval(cinterval);
document.getElementById('memory_board').innerHTML = "";
newBoard();
location.reload();
}
}
// 1,000 means 1 second.
cinterval = setInterval('countdown_timer()', 1000);
function newBoard()
{
11
tiles_flipped = 0;
var output = '';
memory_array.memory_tile_shuffle();
function memoryFlipTile(tile,val)
{
if(tile.innerHTML == "" && memory_values.length < 2)
{
tile.style.background = '#FFF';
tile.innerHTML = val;
if(memory_values.length == 0)
{
memory_values.push(val);
memory_tile_ids.push(tile.id)
}
else if(memory_values.length == 1)
{memory_values.push(val);
12
memory_tile_ids.push(tile.id);
if(memory_values[0] == memory_values[1])
{
tiles_flipped +=2;
memory_values = [];
memory_tile_ids = [];
if(tiles_flipped == memory_array.length)
{
alert("Good Job. Play Again.");
document.getElementById('memory_board').innerHTML =
"";
newBoard();
}
}
else
{
function flip2Back()
{var tile_1 = document.getElementById(memory_tile_ids[0]);
var tile_2 = document.getElementById(memory_tile_ids[1]);
tile_1.style.background='url(images/checkerd.jpg) no-repeat';
tile_1.innerHTML = "";
tile_2.style.background = 'url(images/checkerd.jpg) no-repeat';
13
tile_2.innerHTML = "";
memory_values = [];
memory_tile_ids = [];
}
setTimeout(flip2Back, 700);
}
}
}
}
INDEX.HTML
<html>
<head>
<title>Memory Game</title>
<link href="css/style.css" rel="stylesheet"
type="text/css">
<script type="text/javascript"
src="javascript/memoryboard.js"></script></head>
<body bgcolor="#FFE4C4"><div id="memory_board"></div><script>newBoard();</script>
<script>countdown_timer();</script><p><H1><font
color="#EA4A5A"><CENTER>YOUR
GAME
WILL
END
IN
<span
id="countdown">50</span>
SECONDS.</CENTER></font></H1></p> </body> </html>
14
5. RESULTS
Figure 5
15
Figure 6
16
Figure 7
17
6. CONCLUSION
This game is great for memory training and good to kill some time for kids and
adults. Concentration is a card game in which all of the cards are laid face down on a surface
and two cards are flipped face up over each turn. The object of the game is to turn over pairs of
matching cards. Concentration can be played with any number of players or as solitaire and is an
especially good game for young children, though adults may find it challenging and stimulating
as well. The scheme is often used in quiz shows and can be employed as an educational
game.Nevertheless.Our goal is to show developers how to create an easy game like this with
only a few lines of code for many mobile operation systems .Now you know how to create your
own Puzzle game, which can be easily adapted to your requirements by only changing the
images or number of cards.
18