Code Snippet
procedure CheckGas()
if !G_TROUBLESHOOTING_STATE["Check Gas"]
- Are you out of gas?
? Yes
G_TROUBLESHOOTING_STATE["Check Gas"]++
- You'll have to fill up the tank.
call DidThatFixIt()
? No
G_TROUBLESHOOTING_STATE["Check Gas"]++
- Okay. \c
procedure CheckBattery()
if !G_TROUBLESHOOTING_STATE["Check Battery"]
- Did your battery die?
? Yes
G_TROUBLESHOOTING_STATE["Check Battery"]++
- You need to get a jumpstart.
call DidThatFixIt()
? No
G_TROUBLESHOOTING_STATE["Check Battery"]++
- All right, then. \c
procedure CheckRadiator()
if !G_TROUBLESHOOTING_STATE["Check Radiator"]
- Is there steam coming out of the radiator?
? Yes
G_TROUBLESHOOTING_STATE["Check Radiator"]++
- Wait for the car to cool down, then fill the radiator slowly.
call DidThatFixIt()
? No
G_TROUBLESHOOTING_STATE["Check Radiator"]++
- Okay. \c
procedure Mechanic()
- You probably need to call a mechanic.
procedure DidThatFixIt()
- Did that fix your problem?
? Yes
- Great!
exit all
? No
- Hmm... \c
call CarDied()
procedure CarDied()
call CheckGas()
call CheckBattery()
call CheckRadiator()
call Mechanic()
? my car died
? my car is still dead
call CarDied()