Cyber Risk Simulator is a single-player Python game that combines blackjack-inspired mechanics with cybersecurity-themed challenges.
Players aim to get a hand value as close to 21 as possible while facing random cybersecurity events, reinforcing concepts such as phishing, firewalls, and encryption in an interactive way.
Player: Single-player against an automated dealer.
Objective: Get as close to 21 as possible without exceeding it. Cybersecurity-themed events add an educational twist.
- Both the player and dealer receive two cards from a shuffled 52-card deck at the start of each round.
- A roulette wheel introduces random cybersecurity events:
- Phishing Alert: Answer a cybersecurity question correctly to continue your turn.
- Firewall Down: Dealer receives an extra card.
- Zero-Day Exploit: Dealer’s hand becomes fully visible.
- System Stable: No event occurs.
- During your turn, choose to Hit (draw another card) or Stand (keep your current hand).
- Exceeding 21 results in an automatic loss.
- The dealer draws cards until reaching at least 17. Exceeding 21 causes the dealer to lose.
- Round outcome:
- Player wins if total is closer to 21 than dealer.
- Dealer wins if total is higher.
- Tie if scores are equal.
- Each round lasts one game, but you can play indefinitely until you choose to exit.
- Implemented blackjack-inspired gameplay in Python
- Integrated cybersecurity concepts into interactive events 3.Developed clean, functional, single-file Python code 4.Learned how to structure game logic and handle random events in Python
##🔮 Future Improvements 1.Dynamic Questions: Shuffle questions and answer choices to make gameplay more unpredictable and engaging. 2.Replay Feature: Allow players to continue playing without restarting the program, improving user experience. 3.GUI Interface (Optional): Create a graphical interface for a more interactive experience. 4.Expanded Cybersecurity Events: Add more types of challenges or scenarios to enhance the educational component.
MIT License — free to use and modify for educational purposes.
- Ensure Python 3 is installed.
- Open Visual Studio Code (or any Python IDE).
- Create a
.pyfile and paste the code. - Run the program:
cyberjack_roulette .py