Rock Paper Scissors in C with Source Code

This Rock Paper Scissors project in C Programming is developed using C programming language. is a two-person hand game in which each participant creates one of three shapes at the same time. The game’s winner is determined by the following rules. In this game, the user will be prompted to choose a choice, and the result will be displayed alongside the user’s and computer’s choices.

Anyway if you want level up your knowledge in programming especially C/C++ Programming Language, try this new article I’ve made for you Best C Projects with Source Code for Beginners Free Download 2020. In this project is also includes a downloadable Rock Paper Scissors using c for free, just find the downloadable source code below and click Download Rock Paper Scissors to start downloading.

To run this Rock Paper Scissors project in C make sure that you have a Code Blocks or any platform of C installed in your computer.

Project Name : Rock Paper Scissors
Project Platform :C/C++
Programming Language Used:C Programming Language
Developer Name
IDE Tool (Recommended):Dev-C++/Codeblocks
Project Type :Desktop Application
Database:Stores data in .DAT file
Rock Paper Scissors in C Programming with Source Code Overview

Rock Paper Scissors C Programming Steps On How To Run The Project

Time needed: 5 minutes.

Here’s the step’s on how to create a  Rock Paper Scissors in C Programming  with Source Code.

  • Step 1: Extract file.

    Next, after you finished download the source code, extract the zip file.
    Extract zip file for Rock Paper Scissors in C Programming Source Code

  • Step 2: Open CodeBlocks

    After that, After extracting the zip file, open your “CodeBlocks IDE”.

  • Step 3: Open Project.

    Then, open file tab and Open File after that open folder RPS-GAME-IN-C then click the “main“.

  • Step 4: Run Project

    Lastly, Open build tab and select build and run or you can use key F9.

  • Step 5: The actual code.

    Finally, You are free to copy the given source code below or download the downloadable source code given.

This Rock Paper Scissors C Programming was build and run under Code::Blocks IDE.

  • Function to establish global variables
int printOpt();
void startGame();
int printOpt2();
int player(int user_selection2);
void scores(int *wins, int *loses);
  • Function to Print the Menu of options and lets user play rock, paper, scissor with jack through a series of options.
int printOpt()
    int playerSelect;

    printf("    Press 0 to say no\n");
    printf("    Press 1 to say yes\n");
    printf("    Press 2 to ask for a joke instead\n");
    printf("    Press 3 to ask for another joke\n");
    printf("    Press 4 to say get out\n\t\t");
    scanf("%d", &playerSelect);
    return (playerSelect);
  • The function to Returns user menu of answers and Prints menu and reads in and returns user input
int printOpt2()
    int user_selection2;

    printf("    Press 0 to say I got to go kid\n");
    printf("    Press 1 to say Scissors\n");
    printf("    Press 2 to say Paper\n");
    printf("    Press 3 to say Rock\n\t\t");
    scanf("%d", &user_selection2);
    return (user_selection2);
  • Function to Gets the user selection, Returns a random number and Makes up a random number.
int player(user_selection2)
    int player_choose;
    player_choose = rand()%3;
    return player_choose;
  • Function to Gets Wins and Loses every time the user wins or loses a point, Returns user a scoreboard, and prints a mini scoreboard every time the user wins or loses a point
void scores(int *wins, int *loses)
    printf("The score board is now:\n");
    printf(" Juan - You\n");
    printf(" %d         %d\n\n",loses, wins);

Downloadable Source Code


This Rock Paper Scissors in C Programming Language with Source is only a project made for school requirement purposes only. A Rock Paper Scissors C language was created specifically for a semester project.

It aims to give beginners a good understanding of programming small to large projects by imparting general workable and practical information about C.

You can download this program and modify it to suit your client requirements, since this is a student project it means you cannot really expect 100% functionality from this.


If you have any questions or suggestions about Rock Paper Scissors C Programming Source Code, please feel free to leave a comment below.

Leave a Comment