Stone-Paper-Scissor-Game

Hello coders and developers!
This is the first game I have made using Python. I have not used any library like PyGame. I have developed it using the random module in the Python Standard Library.

Python Standard Library

Python Standard Libra…


This content originally appeared on DEV Community and was authored by Jai Irkal

Hello coders and developers!
This is the first game I have made using Python. I have not used any library like PyGame. I have developed it using the random module in the Python Standard Library.

Python Standard Library

Python Standard Library is a set of modules which are included with every Python installation.
One of them used in this game is random module.

Random Module

Important functions in the random module are randint() and choice().
In this game I have used the choice() function.
1. randint() ---> This function returns any random integer within the given arguments.
2. choice() ---> This function returns a random value from a tuple or a list.

Talking about my game, it takes a user input for stone paper or scissors and the computer chooses a random value i.e. stone paper or scissors. You know the rest rules I think ?
So this was the simple logic I used.

The link for all the files is here. I have also converted the game into a module so that it looks clean ?

Happy Coding! ?‍??‍?

GitHub logo JaiIrkal / Stone-Paper-Scissors-Game

Stone paper scissors game using Python

Stone-Paper-Scissors-Game

Stone paper scissors game using Python

A simple stone paper scissors game like we used to play when we all were kids. Simple Python is being used using the random module from Standard Python Library.

I have also converted the game into module for simple use...





This content originally appeared on DEV Community and was authored by Jai Irkal


Print Share Comment Cite Upload Translate Updates
APA

Jai Irkal | Sciencx (2021-07-28T17:17:12+00:00) Stone-Paper-Scissor-Game. Retrieved from https://www.scien.cx/2021/07/28/stone-paper-scissor-game/

MLA
" » Stone-Paper-Scissor-Game." Jai Irkal | Sciencx - Wednesday July 28, 2021, https://www.scien.cx/2021/07/28/stone-paper-scissor-game/
HARVARD
Jai Irkal | Sciencx Wednesday July 28, 2021 » Stone-Paper-Scissor-Game., viewed ,<https://www.scien.cx/2021/07/28/stone-paper-scissor-game/>
VANCOUVER
Jai Irkal | Sciencx - » Stone-Paper-Scissor-Game. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/28/stone-paper-scissor-game/
CHICAGO
" » Stone-Paper-Scissor-Game." Jai Irkal | Sciencx - Accessed . https://www.scien.cx/2021/07/28/stone-paper-scissor-game/
IEEE
" » Stone-Paper-Scissor-Game." Jai Irkal | Sciencx [Online]. Available: https://www.scien.cx/2021/07/28/stone-paper-scissor-game/. [Accessed: ]
rf:citation
» Stone-Paper-Scissor-Game | Jai Irkal | Sciencx | https://www.scien.cx/2021/07/28/stone-paper-scissor-game/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.