0% found this document useful (0 votes)
13 views9 pages

Sample Report - PPS - Project - STONE PAPPER SCISSOR GAME

The document is a project report on the Stone, Paper, Scissors game developed in C, detailing its gameplay mechanics, features, and implementation. It includes user vs computer gameplay, random move generation, and clear game logic, while also outlining system requirements and limitations. The report concludes with a brief overview of the game's functionality and user interaction.

Uploaded by

pprit3396
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views9 pages

Sample Report - PPS - Project - STONE PAPPER SCISSOR GAME

The document is a project report on the Stone, Paper, Scissors game developed in C, detailing its gameplay mechanics, features, and implementation. It includes user vs computer gameplay, random move generation, and clear game logic, while also outlining system requirements and limitations. The report concludes with a brief overview of the game's functionality and user interaction.

Uploaded by

pprit3396
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

GUJARAT TECHNOLOGICAL UNIVERSITY CHANDKHEDA,AHMEDABAD

AFFLIATED

SAL INSTITUTE OF TECHNOLOGY & ENGINERING RESEARCH

A PROJECT REPORT ON

SPS Game
UNDER THE SUBJECT OF

Programming for Problem Solving (PPS)-BE01000121

SUBMITTED BY :

240670107085 PATEL PRIT

240670107087 PATEL SAVAN

240670107088 PATEL TEJ

240670107071 PATEL DHRUV

240670107070 PATEL DEV

GUIDED BY :
Birendrasinh zala
-Asst.professor
-Computer Engineering Department
INTRODUCTION
The Stone, Paper, Scissor game is a simple hand game usually played between two
people, where each player simultaneously forms one of three shapes with an
outstretched hand: stone (rock), paper, or scissors. In this C implementation, the
game is simulated between a user and the computer.

KEY FEATURES
User vs Computer Gameplay

 The player competes against the computer, which selects its move randomly.

Random Move Generation

 The computer's choice is generated using the rand() function for


unpredictability.

Simple User Interface

 Input is taken from the user via the console using scanf(), and results are
displayed with printf().

Clear Game Logic

 Implements classic rules: Stone beats Scissor, Scissor beats Paper, Paper beats
Stone.

HOW IT WORKS
1. Set up & Initialization.

2. Takes User Input and validates it (case-insensitive).

3. Generating computer choice.

4. Comparing choices.

5. Display the result.


Class Name
The main class name is stone, papper, scissors Game because it contains the main
function, which serves as the entry point of the C program. When saving this file,
name it spsGame.c to match the class name.

This project is a simple game application developed in C. It presents multiple-choice


questions to the user, collects responses, and calculates the result. The program
includes features such as randomized choices, input validation, and attempts to ensure
a fair game experience.

Concepts and Things Used in This Code:


1. Header Files

 #include <stdio.h>: Enables input/output functions like printf() and scanf().

 #include <stdlib.h>: Provides rand() and srand() functions for random number
generation.

 #include <time.h>: Used to seed the random number generator with current time
using time(0).

2. Random Number Generation

 srand(time(0)); : Seeds the random number generator so you get different


results each time the program runs.

 rand() % 3 + 1; : Generates a random number between 1 and 3 (inclusive),


representing Rock, Paper, or Scissors.

 srand(time(0)); : Seeds the random number generator so you get different


results each time the program runs.
 rand() % 3 + 1; : Generates a random number between 1 and 3 (inclusive),
representing Rock, Paper, or Scissors.

3. User Input

 scanf("%d", &userchoice);: Reads the user's choice from the keyboard.

4. Conditional Statements

 if, else if, else: Used to determine the result of the game based on user and
computer choices.

5. Game Logic Implementation

Compares choices to decide who wins, following standard game rules:

 Rock beats Scissors

 Scissors beats Paper

 Paper beats Rock

System Requirements:

Minimum Intel Core i3, 2GB RAM, 10MB storage, Windows/macOS/Linux,


GCC/Clang/MSVC compiler, and a terminal or IDE like VS Code, Code::Blocks, or DevC+
+.
INPUT:
OUTPUT:
TEST CASE # Player Choice Computer Choice Expected Result

TC01 ROCK SCISSORS PLAYER WIN

TC02 ROCK PAPPER COMPUTER WIN

TC03 ROCK ROCK TIE

TC04 PAPPER ROCK PLAYER WIN

TC05 PAPPER SCISSORS COMPUTER WIN

TC06 PAPPER PAPPER TIE

TC07 SCISSORS PAPPER PLAYER WIN

TC08 SCISSORS ROCK COMPUTER WIN

TC09 SCISSORS SCISSORS TIE

TC10 INVALID - SHOW ERROR OR


INPUT(EG. 5) PROMPT AGAIN

TEST CASES

Limitations

Limitations:

1. Poor input validation – The code may not check for invalid inputs (e.g., letters
or numbers outside the allowed range).
2. Loop feature – Many basic versions run only once and then exit.

3. No score tracking –It doesn't keep track of wins, losses, or draws over multiple
rounds.

4. Weak randomness - If srand(time(NULL)) isn't properly used, the computer’s


move might repeat in each run.
5. Console only - It only uses command-line input/output.

6. Limited to Rock, Paper, Scissors - Doesn't support extensions like "Rock, Paper,
Scissors, Lizard, Spock.

7. Not Modular - All code might be in main() or unstructured.

Conclusion
This quiz program provides a simple game to fun with users. It ensures user interaction with random
computer choice and basic input validation.

References
The C Programming Language – Book

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy