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! ????
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
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/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.