Game of Stone Paper Scissors

Words
267
Reading
2 min
Listen
Play
5y

Hello to all brilliant peoples of the community. I recently started studying python programming language and tried creating a simple game of Stone paper Scissors. We all have played the game of Stone Paper Scissors in our childhood. Stone paper scissors is a hand game usually played between two people, in which each player simultaneously forms one of three shapes with an outstretched hand. These shapes are "Stone" (a closed fist), "paper" (a flat hand), and "scissors" (a fist with the index finger and middle finger extended,).
Image Source

game1.jpg

I tried to implement the logic of the game programmatically. In this simple python program one can play the game with computer. It's simple yet enjoyable.

line.png

The number 1 is for stone, 2 is for Paper and 3 is for Scissors.

image.png

The Computer chose it's move randomly. Its a tie if both the player and computer have the same choice and gains the value of 1 if anyone wins.

image.png

The game goes on till anyone of the player or computer have 5 points. Whoever scores 5 points earlier will win. Then one can chose to play again or exit.

image.png

line.png

It's not a complex game but really interesting to build it. The snapshot of the source code of the program are as follows.

image.png

image.png

image.png

image.png

line.png

The program contains 100 lines of code and was created on IDLE. I know it can be optimized but I am just beginning to learn python so it's a start馃檪馃檪馃檪馃檪馃檪. If you guys have any suggestions to improve the code feel free to comment. Thank you all, have a great life. This is biggestloser@biggestloser signing off....

line.png


BiggestLoser.gif

Game of Stone Paper Scissors | Ecency