Continued slotmachine

This commit is contained in:
2026-05-16 02:45:12 +02:00
parent 04a60f9890
commit 14a0287edd
2 changed files with 25 additions and 5 deletions

BIN
exe/slotmachine Executable file

Binary file not shown.

View File

@@ -1,3 +1,5 @@
#include <iostream>
enum class MachineState { enum class MachineState {
Startup, Startup,
Ready, Ready,
@@ -5,16 +7,34 @@ enum class MachineState {
Release, Release,
Unlock, Unlock,
Shutdown Shutdown
} };
// SIMULATING HARDWARE-REQUESTS // SIMULATING HARDWARE-REQUESTS
int main() { int main() {
MachineState state = MachineState.Startup;
while(true) {
state = MachineState.Ready;
std::string = std::cin << "Pick your slot" << std::endl; MachineState state = MachineState::Startup;
state = MachineState::Ready;
while(true) {
std::string input;
switch (state) {
case MachineState::Ready: {
std::cout << "Pick a number" << std::endl;
std::getline(std::cin, input);
std::cout << "Coast: 15€" << std::endl;
state = MachineState::PendigPayment;
break;
}
case MachineState::PendigPayment: {
break;
}
}
} }
return 0; return 0;
} }