MoneyHeistMachine™ - A C++ Slot Machine Simulator
A graphical slot machine simulator built with C++ and Qt Widgets, implementing finite state machine principles and hardware abstraction.
Grade: 9.5
MoneyHeistMachine™ - Slot Machine Simulator
The MoneyHeistMachine™ is a slot machine simulator developed as part of the PROG4 assignment at HAN University. This project challenged me to expand my C++ programming skills while implementing object-oriented programming principles and creating a user-friendly graphical interface using Qt Widgets.
Content
The final application features a complete slot machine experience with realistic game mechanics, admin tools, and a statistical profit model that guarantees the house always wins in the long run - just like real casino machines!
System Abstract
This project aimed to create a realistic slot machine simulator that demonstrates hardware abstraction layer (HAL) principles. The system simulates hardware events through software interfaces and implements a finite state machine model to manage game states and user interactions.
The architecture follows a layered approach with clear separation between user interface, system control, and hardware abstraction layers, making the system maintainable and expandable.
Features
- Finite State Machine Implementation: Clean state management with defined transitions between INIT, STAKE, GAMBLE, PAYOUT, and money insertion states.
- Hardware Abstraction Layer: Software simulation of hardware events like coin insertion, button presses, and reel spinning.
- Statistical Game Model: Mathematically sound probability model ensuring a 7% profit margin for the house over time.
- Admin Tools: Comprehensive logging system for monitoring system states, transactions, and potential fraud detection.
- User-Friendly Interface: Intuitive GUI with clear instructions and visual feedback for all game actions.
- Animated Reels: Visual reel spinning animation with realistic timing and random intermediate values.
- Recovery Options: Built-in protection against invalid user actions and full refund capabilities.
- Balance Management: Secure handling of user credits with real-time balance updates.
Technologies Used
- Programming Languages: C++ with object-oriented programming principles, plus C for the core gambling engine.
- GUI Framework: Qt Widgets library for cross-platform graphical interface development.
- IDE: Qt Creator for integrated development and debugging.
- Design Patterns: Finite State Machine pattern for game flow control.
- Testing: White-box testing methodology with comprehensive acceptance testing.
Game Mechanics
The slot machine uses a carefully designed mathematical model based on probability calculations:
- 3 Reels: Each with different symbol distributions (4, 5, and 3 indexes respectively)
- 60 Possible Combinations: Mathematical product of all reel possibilities
- 8 Payout Types: From 1x to 30x multipliers, with the jackpot (4-4-4) paying 30 times the bet
- 93% Return Rate: Players can expect to get back 93% of their total stakes over time
- 7% House Edge: Guaranteed profit margin for the machine operator
Implementation Highlights
The system architecture demonstrates several advanced programming concepts:
State Management: Each state (INIT, STAKE, GAMBLE, etc.) has dedicated entry and exit functions that handle UI updates, logging, and business logic. Hardware Abstraction: The system simulates real hardware components through software events, making it easy to later connect actual hardware without changing the core logic. Robust Testing: Comprehensive acceptance testing ensures all functional, technical, and non-functional requirements are met. Professional Documentation: Complete technical documentation including requirements analysis, system design, and user manuals.
Learning Outcomes
This project provided hands-on experience with:
- Object-oriented programming in C++
- GUI development with Qt Widgets
- Finite state machine design patterns
- Hardware abstraction principles
- Technical documentation in English
- Software testing methodologies
The project successfully met all requirements and passed comprehensive acceptance testing, demonstrating the effectiveness of systematic software development approaches.
Future Enhancements
The system was designed with expansion in mind. Potential improvements include:
- Enhanced Graphics: Custom icons and visual effects instead of numeric displays
- User Authentication: Login system for both users and administrators
- Payment Integration: Support for card payments and mobile transactions
- Gamification Features: Audio effects, leaderboards, and skill-based game modes
- Advanced Analytics: More sophisticated fraud detection and player behavior analysis
Currently, the project demonstrates the successful implementation of a complex GUI application using modern C++ and Qt frameworks, while maintaining professional software development standards throughout the entire development lifecycle.
This project was completed as part of the sensors and actuators based project (EMBSOC01-PROG4) course at HAN University of Applied Sciences, Embedded Systems Engineering program, S2 2021-2022.