This documentation provides an overview of the Rock-Paper-Scissors game developed in Python with a graphical user interface (GUI) using the tkinter library.
The Rock-Paper-Scissors game is a classic hand game that is typically played between two people. This Python implementation allows you to play against the computer with a simple GUI.
To run the game, ensure you have Python installed and the tkinter library available. If not, you can install tkinter using the following command:
pip install tk
After setting up the environment, you can run the Python script to start the game.
The game follows the traditional rules of Rock-Paper-Scissors:
- Rock beats Scissors
- Paper beats Rock
- Scissors beats Paper
In case both the player and the computer choose the same item, it's a tie.
- Launch the game. You will see a GUI with three buttons: "Rock," "Paper," and "Scissors."
- Click one of the buttons to make your choice.
- The computer will randomly choose its move.
- The result will be displayed on the GUI, indicating whether you won, the computer won, or it's a tie.
The code for the Rock-Paper-Scissors game is divided into two main parts:
GUI setup: This section initializes the GUI window and creates buttons for the game options.
Game logic: It includes functions to determine the winner based on the player's choice and the computer's random choice. The result is displayed on the GUI.
Enjoy playing Rock-Paper-Scissors!