Project on Rock Paper Scissor
Game
Project guide:
[Link] Kumar Naik
(PGT Computer Science)
Submi ed By:
Simran Priyadarsani Pradhan
Sameekshya Mishra
Rutuparna Mahapatra
Anil Kumar Naik Date:
PGT Computer Science,
OAV, Madanpur
This is to cer fy that the work in the thesis en tled “Rock -
Paper-Scissor Game” by Rutuparna Mahapatra bearing roll
number ROLLNO: _____________ is a record of project work
carried out by them under my supervision and guidance in
par al fulfilment of the requirements for the award of the
course of XII Science Informa on Technology (Code-802)
Anil Kumar Naik
Odisha Adarsha Vidyalaya, Madanpur
Approval Cer ficate
This is to cer fy that the project work en tled
“Rock-Paper-Scissor Game”
Has been sucessfully completed
By
Simran Priyadarsani Pradhan, Sameekshya Mishra &
Rutuparna Mahapatra
Under the guidence of
Anil Kumar Naik
(PGT Computer Science)
Odisha Adarsha Vidyalaya, Madanpur
Project Guide: Internal Examiner External Examiner
Anil Kumar Naik
PGT Computer Science
OAV, Madanpur, Kalahandi
Acknowledgment
This disserta on, though an individual work, has benefited in
various ways from several people. It would be simple to name them
all, but not easy to thank them enough.
I take this opportunity to express my sincere and hear elt gra tude
towards my guide and mentor Anil Kumar Naik Sir, forhis supervision,
inspira on and help in all regards during the en re dura on of my
project. The blessings, guidence and encouragement given by him shall
carry me a long way in the journey of life on which I am about to remark.
I am especially indebted to my parents as they were always there for
me in all the ups and downs of my life. They were my first teachers and
always will set great examples for me live, study and work. Lastly the
Almighty God is worthy of all my gra tude throughout the life.
Simran Priyadarsani Pradhan Sameekshya Mishra Rutuparna Mahapatra
This paper describes the Rock-Paper-Sissor Game Project, which is a
XII Science CBSE Board prac cal project at the OAV, Madanpur,
Kalahandi. The central aim of the project was to test the speed and
usability of this applica on online.
Keywords: Java, NetBeans IDE
Introduc on …………………………………………….7
So ware Requirement Specifica on …………8
So ware Design Document ……………………13
Implementa on & Screenshots ………………15
So ware test Documenta on ………………..20
Conclusion ……………………………………………23
Chapter 1
1.1 Aim:
The aim of developing the Rock-Paper-Scissor game project is to
help beginners prac ce and understand fundamental programming
concepts such as user input handling, randomiza on, condi onals,
and loops. By crea ng a simple game where the player competes
against the computer, users can apply logical thinking and program-
solving skills to implement the rules of the game (Rock bests
Scissors, Scissors beats Paper, Paper beats Rock). This project
provides a hands-on approach to learning basic coding concepts
while offering immediate feedback. Addi onally, it servesas a
founda on for expanding the game with features like score tracking
or a graphical interface, helping developers build confidence in
crea ng interac ve applica ons.
Technology Used:
Front End: NetBeans IDE
Back End: MySQL
Chapter 2
Software Requirement Specification
2.1 Introduc on:
The Rock-Paper-Scissors game project is simple yet engaging peogramming exercise
where a user competes against a computer in a hand game with three possible
choices: Rock, Paper, or Scissors. The project involves crea ng a program that takes
the user’s input, generates a random selec on for the computer, and compares both
to determine the winner based on predefined rules. It’s an excellent way to prac ce
key programming concepts like condi onals, randomiza on, and loops while
providing a fun and intrerac ve experience. This project can be implemented in
various programming languages and serves as a great star ng point for beginners.
In a Rock-Paper-Scis Project, the global is o en to develop a program that mimics the
game, where a player competes against the computer. The computer randomly selects
one of the three op ons (Rock, Paper, or Scissors), and the user inputs their choice. The
program compares the two choices and announces the winner, or if there is a e.
2.2 Purpose:
The purpose of the Rock-Paper-Scissors Project is to provide an engaging and
educa onal opportunity for beginners to apply fundamental programming concepts
in a fun and interac ve way. By designing and implemen ng the game, users
prac ce essen al skills such as handling user input, u lizing condi onals (if-else
staments), genera ng random values, and implemen ng game logic. The project
serves as an excellent introduc on to problem-solving, as it requires the developer
to translate real-world rules (Rock beats Scissors, Scissors beats Paper, Paper beats
Rock) into code. It also encourages the use of loops to allow users to play mul ple
rounds, reinforcing the importance of strucyture and repe on in programming. As
a simple yet versa le project, it offers room for future enhancements, such as
adding a graphical user interface (GUI), implementa on score tracking, build
confidence in their programming abili es, offering a solid founda on for more
complex projects down the road. It fosters crea vity while allowing the developers to
see immediate results from their code, making it an ideal learning tool for new
programmers.
2.3 Document Conventa ons Purpose:
Font Style Size
Heading Times New Roman Bold 12
Sub-Heading Times New Roman Bold, Italic 12
Others Times New Roman Regular 12
2.4 Intended Audience and Reading Sugges ons
The Rock-Paper-Sessior Game project is intended for students learning
programming concepts, educators evalua ng project implementa on, beginners
prac cing coding fundamentals, and reviewsers assessing the project’s
requirements and funca onalty. To understand the project effec vely, readers
should start with Introduc on to gain an overview, followed by the Document
Conven on to familiarize themselves with the structure and terminology used.
They should then proceed to the Requirements sec on for detailed
specifica ons, explore the System Design to understand the workflow, and
finally, refer to the Tes ng sec on to review the valida on methods. This
approach ensures a comphrehensive understanding of the project’s objec ves
and implementa on.
2.5 Overall Descrip on
2.5.1 Product Persep ve
The Rock-Paper-Scissors game project offers a simple, interacrive experience
where users play against a computer. It helps beginners prac ce programming
concepts like condi onals and recomiza on. The game is user-friendly and can be
expanded with feathers like score tracking or a graphical interface. It serves as an
engaging learning tool for new developers.
2.5.2 Product Features
There are three different users who will be using this product:
Anyone can use it offline.
NA
The features available to the students are:
Can use Rock-Paper-Scissor Game offline.
2.5.3 User Classes and characteris cs
There are various kinds of users for the product. Usually, web products are visited
by various users for different reasons.
The users include:
Students/Others who will be using the above features by accessing the Rock-Paper-
Scissor Game online.
2.5.4 Opera ng Environment
The product will be opera ng in windows environment.
2.5.5 Design and implementa on constraints
NA
2.5.6 Assump ons and dependencies
The users have sufficient knowledge of computers. The ins tute computer should
have internent connec on and internent server capabili es.
2.6 External Interface Requirements
2.6.1 User Interface
The usrs have sufficient knowledge of computers. The ins tute computer should
have internent connec on and internent server capabili es.
2.6.2 Hardware Interface
The client machine: Processer, RAM, Hard Disk
2.6.3 So ware Interface
Opera ng system: Windows
2.7 System features
Descrip on and Priority:
User should be able to see all informa on about game project.
S mulus.
NA
Func onal Requirements:
Once open the web page you can see the home page of Rock-Paper-Scssor Game.
2.8 Non-func onal requirements
2.8.1 Performance Requirements
The Rock-Paper-Scissor Game should meet several nin-func onal performance
requirements to ensure a smooth and efficient user experience. The game must
load quickly, with minimal delay between user input and feedback, ensuring
responsiveness in real- me interac ons. It should be capable of handling mul ple
rounds without performance degrada on, providing seamless gameplay even
a er numerous a empta. The program should be op mized to run on typical
personal computers with basic specifica ons, without requiring significant system
resources. Adi onally, the game should be stable, with no crashes or unhandled
reeors, ensuring consistent performance throughout the session. The interface
should remain intui ve and clear, with fast and accurate processing of user input
and output.
2.8.2 safety Requirements
The database may get crashed at any certain me dur to virus or opera ng
system failure. Therefore, it is required to take the database backup.
2.8.3 Security Requirements
We are going to develop a secured database for the game. There are different
categories of users namely administrator, Students and other users etc.
Dependency upon the category of the user the access rights are decided. It means
if the user is administrator then he is able to modify the data, delete, append etc.
All other users other then administrator only have the rights to retrive the
informa on about the database and play games.
2.8.4 So ware Quality A ributes
The quality of the database is maintained in such a way so that it can be very
user friendly to all the users of the database.
2.8.5 Hardware Constraints
The system requires a database in order to store prrsistent data. The database
should have backup capabili es.
2.8.6 Design Constraints
The system must be designed to allow system usability. That is, the system
must be designed in such a way that will be easy to use and visible on most of
the system.
2.8.7 So ware Constraints
The development of the system will be constrained by the availability of
required So ware such as we server, database and development tools. The
availability of these tools will be governed by the administrator.
Chapter 3
3.1 High Level Design Document
3.1.1 Purpose of this document:
The purpose of this High-Level Design (HDL) document is to provide an overview
of the architecture and design approach for Rock-Paper-Scissor Game project. It
outlines the key components, their interac ons, and the overall system structure,
offering a blueprint for developers to follow during implementa on. This
document serves as a guide to ensure that the game is built according to the
specified requirements and follows best prac ces in terms of design,
func onality, and performance. It also helps in iden fying poten al challenges
and design decisions early in the development process, ensuring the project is
executed efficiently and meets the desired objec ves. The HDL documents aim to
provide a clear understanding of the system’s design for all stakeholders,
including developers, testers, and project reviewers.
3.1.2 Defini ons, acronyms, and abbrevia ons
GUI – Graphical User Interface
3.1.3 Overview of document
The High-Level Design (HDL) document provides an overview of the architecture
and key components for the Rock-Paper-Scissor Game project. It outlines the
system’s goals, components, and their interac ons, including the user interface
and data flow. The document also covers design constrints, assump ons, and
technology choices, serving a blueprint for the development process. It ensures
that the design aligns with the project’s requirements and provides a clear guide
for implementa on.
3.1.4 System architecture descrip on
[Link] Overview of modukes/components:
There are four basic, logical components of the system: The Database, the GUI,
the Server Applica on, and the Client Applica ons.
[Link] Structure and rela onships:
GUI:
. GUI provide a user interface.
Client Applica ons:
. Contains all presenta on logic.
. Interacts with the user.
. Communicates with the server applica on.
Server Applica on:
. Provides method and procedures that can be invoked by a client applica ons
via the server.
Chapter 4
4.1 Implementa on
The purpose of this applica on is that; it will be more user-friendly and it will
be available offline. Anyone can access the applica on from any kind of
device which supports Windows OS.
4.1.1 Front-end
To implement this applica on, we are using NetBeans IDE.
4.1.2 Back-end
NA
Program:
[Link]
import [Link].*;
import [Link].*;
import [Link] onEvent;
import [Link] onListener;
public class RockPaperScissorGUI
extends JFrame implements
Ac onListener {
private JLabel resultLabel;
private JLabel
computerChoiceLebel;
private Random random;
public RockPaperScissorsGUI() {
random=new Random();
setTitle(“Rock paper scissors Game”);
setSize(400, 300);
setDefaultCloseOpera on(EXIT_ON_CLOSE);
setLoca onRela veTo(null);
//Set layout
setLayout(new BorderLayout() );
//Title label
JLabel tleLabel = new JLabel(“Rock Paper Scissors”, [Link]);
[Link](new Font(“Arial”, Font. BOLD,18) );
add( tleLabel, [Link]);
//Result pannel (center)
JPanel centerPanel = new JPanel();
[Link](new GridLayout(2,1) );
computerChoiceLabel= new JLabel(“Computer’s Choice: “ ,
[Link]);
[Link](“Arial” ,
[Link], 14) );
[Link](computerChoiceLabel);
resultLabel = new JLabel(“Make your choice!” ,
[Link]);
[Link](new Font(“Arial”, [Link],14) );
[Link](resultLabel);
add(centerPanel,
[Link]);
//Bu ons (south)
JPanel bu onPanel = new JPanel();
bu [Link](new
FlowLayout() );
JBu on rockBu on = new JBu on(“Rock”);
rockBu [Link] onListener(this);
Bu [Link](rockBu on);
JBu on paperBu on = new JBu on(“Paper”);
paperBu [Link] onListener(this);
bu [Link](paperBu on);
JBu on scissorsBu on = new JBu on(“Scissors”);
scissorsBu [Link] onListener(this);
bu [Link](scissorsBu on);
add(bu onPanel,
[Link]);
setVisible(true);
}
@Override
public void ac onPerformence(Ac onEvent
e) {
String userChoice = [Link] onCommand();
String computerChoice = getRandomChoice();
[Link](“Computer’s Choice: “ +computerChoice);
String result = determineWinner(userChoice,
computerChoice);
[Link](result);
}
private String get RandomChoice() {
String[]choices = {“Rock”, “Paper”, “Scissors”};
return choices[[Link](3)];
}
private String determineWinner(String user, String computer) {
if ([Link](computer)) {
return “It’s a Tie!”;
}
If (([Link](“Rock”)&& [Link](“Scissors”))
||
([Link](“Paper”)&& [Link](“Rock”)) ||
([Link](“Scissors”)&& [Link](“Paper”)))
{
return “You Win!”;
} else {
return “Computer Wins!”;
}
}
public sta c void mains(String[]
args) {
new
RockPaperScissorsGUI();
}
}
Screenshots:
Fig: Rock-Paper-Scissors Game home page
Chapter 5
5.1 unit Test Documenta on
Purpose:
The purpose of this unit test documenta on is to demonstrate logic,
programming, and decision making the Rock-Paper-Scissors Game. The project
aims to explore game logic, implement condi onal statements, and enhance
programming skills while providing users with a simple, fun, and interac ve
experience. It can also be used to understand randomness, user interac on, and
interface design in digital development.
Test Case ID : player makes valid moves
. Purpose: ensure that the player can make a valid move by clicking one of
the op ons (rock, paper, scissors).
. Input: click on rock or paper or scissor bu on.
. Expected Output: The bu on which is clicked the player move should be
displayed as that bu on
.Pass/Fail: Pass(the move is displayed correctly in the player_move
area(e.g., “rock”, “paper”,or “scissors”). Fail(the displayed move is
incorrect or missing).
Test Case ID 2: Game Outcome( Win, Lose, Draw)
. Purpose: Verify that the game correctly determine and displays the outcome
based on the player’s move and the computer’s random selec on.
. Input: Player selects “Rock”.
Player selects “Paper”.
Player selects “Scissors”.
. Expected Output: Player selects (rock) computer selects (scissors) outcome
(player wins).
. Pass/Fail: Pass (show win, lose,draw inoutcome area). Fail (wrong outcome
or no outcome will show).
Test Case ID 3: Invalid Handling
. Purpose: Ensures that the game handles invalid user inputs appropriately,
such as clicking unrecognized bu ons or submi ng without making a
selec on.
. Input: A emts to click a non-exis ng bu on(e.g., an “invalid” bu on).
. Expected Output: An error message appear promo ng the user to make
valid selec on.
. Pass/Fail: Pass (an error message e.g., plese select a move before playing).
Fail (no error message appears. Or the game behaves unexpectedly).
Test case ID 4: GUI element visibility
. Purpose: Verify that all important GUI elements(bu ons, result display) are
visible and func onal.
. Input: Load the game screen.
. Expected Output: Visible and able to show game outcome (win, lose, draw).
The display appropriate message or error states when required.
. Pass/Fail: Pass (all key elements(bu ons, result areas) are visible and
func onal). Fail (any cri cal element is missing or not interac ve.
Test Case ID: 5 Edge Case Handling in GUI
. Purpose: Tests how the game handles edge cases, such as rapid
mul ple clicks or trying to submit without making a selec on.
. Input: Rapidly click on rock, paper, scissor.
A empts to play the game without selec ng a move.
. Expected Output: Only accept the last valod move made by the player. If
no move is selected, the game should display am error message asking the
user to select a move before playing.
. Pass/Fail: Pass(if game correctly processes the last valid input). Fail(does
not handle the edge case correctly).
In conlusion, the Rock Paper Scissor project successfully demonstrates the
applica on of basic programming concepts, logic, and decision-making
through a simple yet interac ve game. This peroject hands-on experience
in implemen ng game rules, condi onal statements, and user
interac ons, while highli ng problem-solving and coding skills. Whether
developed digitally or physically, the project emphasizes ctrea vity,
simlicity, and learning through engagement. It serves as an excellent
founda on for exploring advanced programming concepts and enhancing
computa onal thinking.