Skip to content

jjggu97/Rock-Paper-Scissor-Simulation

Repository files navigation

Rock, Scissor, Paper

Python scripts simulate the rock, scissor, paper game.

rock_scissor_paper.py

This script allows users to play the rock, scissor, paper game against the computer.

It prompts the user to make a choice and compares it with the computer's choice to determine the outcome.

How to use

  1. Clone or Download repository.

  2. Open rock_scissor_paper.py, and compile script.

  3. When script prompted, Enter rock, paper or scissor.

rock_scissor_paper_simulation.py

This script simulates the outcome of the rock, scissor, paper game and visualizes the win probability using a pie chart.

How to use

  1. Run the script, and it will simulate the rock, scissor, paper game a specified number of times.

  2. It records the outcomes of each simulation and calculates the win probability.

  3. The results are visualized using a pie chart.

Example

rock_scissor_paper_simulation

rock_scissor_paper_first_to_two_wins_simulation.py

This script simulates the rock, scissor, paper game according to the "3 out of 5, first to 3 wins" rule and visualizes the win probability using a bar chart.

Example

rock_scissor_paper_first_to_two_wins_simulation

Conclusion

As you can see, rock-paper-scissor is realllllly fair game!

References

https://learningpenguin.net/2020/02/06/a-simple-algorithm-for-calculating-the-result-of-rock-paper-scissors-game/

https://realpython.com/python-rock-paper-scissors/

Releases

No releases published

Packages

No packages published

Languages