https://github.com/rahulrmcoder/python-oops-mini-project3
https://github.com/rahulrmcoder/python-oops-mini-project3
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/rahulrmcoder/python-oops-mini-project3
- Owner: RahulRmCoder
- Created: 2024-06-19T16:44:02.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T17:20:37.000Z (about 2 years ago)
- Last Synced: 2024-06-21T05:44:06.992Z (about 2 years ago)
- Language: Jupyter Notebook
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python-OOPS-Mini-Project3
# Card Game
### Question 4:Create a simple Card game in which there are 8 cards which are randomly chosen from a deck. The first card is shown face up. The game asks the player to predict whether the next card in the selection will have a higher or lower value than the currently showing card.
### For example, say the card that’s shown is a 3. The player chooses “higher,” and the next card is shown. If that card has a higher value, the player is correct. In this example, if the player had chosen “lower,” they would have been incorrect. If the player guesses correctly, they get 20 points. If they choose incorrectly, they lose 15 points. If the next card to be turned over has the same value as the previous card, the player is incorrect.
# Card Game
## Overview
This project is a simple card game where the player predicts whether the next card in a randomly chosen selection will have a higher or lower value than the currently displayed card. Points are awarded or deducted based on the correctness of the prediction.
## Game Rules
1. **Deck Preparation:** A simplified deck of cards with values from 1 to 13 is used, with four suits.
2. **Card Selection:** Eight cards are randomly chosen from the deck.
3. **Gameplay:**
- The first card is shown face-up.
- The player predicts whether the next card will be higher or lower.
- If the prediction is correct, the player earns 20 points.
- If the prediction is incorrect, the player loses 15 points.
- If the next card has the same value, the player loses 15 points.
## How to Play
1. **Start the Game:** Run the program to shuffle the deck and select eight cards.
2. **Make Predictions:** The game will prompt you to predict whether the next card is higher or lower.
3. **Score Points:** Points are awarded or deducted based on your predictions.
4. **End of Game:** The game ends after all eight cards have been shown. The final score is displayed.
## Example
First card: 3
Will the next card be higher or lower? (h/l): h
Next card: 7
Correct!
Current points: 20
...
Final points: 45