Continued slotmachine
This commit is contained in:
BIN
exe/slotmachine
Executable file
BIN
exe/slotmachine
Executable file
Binary file not shown.
@@ -1,3 +1,5 @@
|
||||
#include <iostream>
|
||||
|
||||
enum class MachineState {
|
||||
Startup,
|
||||
Ready,
|
||||
@@ -5,16 +7,34 @@ enum class MachineState {
|
||||
Release,
|
||||
Unlock,
|
||||
Shutdown
|
||||
}
|
||||
};
|
||||
|
||||
// SIMULATING HARDWARE-REQUESTS
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user