Created
December 9, 2018 18:46
-
-
Save jorgecc/fc66e03fb24daa3bbcc772b0611596bb to your computer and use it in GitHub Desktop.
BuyMilk2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// it is specific for this project | |
define('INITIAL_STATE',1); | |
define('DRIVING_TO_BUY_MILK',2); | |
define('CANCEL_DRIVING',3); | |
define('PICKING_THE_MILK',4); | |
define('PAYING_FOR_THE_MILK',5); | |
define('UNABLE_TO_PURCHASE',6); | |
define('DRIVE_BACK_HOME',7); | |
$smachine->setDefaultInitState(INITIAL_STATE); | |
$smachine->setStates([ | |
INITIAL_STATE=>'Initial State', | |
DRIVING_TO_BUY_MILK=>'Driving to buy milk', | |
CANCEL_DRIVING=>'Cancel driving.', | |
PICKING_THE_MILK=>'Picking the milk', | |
PAYING_FOR_THE_MILK=>'Paying for the milk', | |
UNABLE_TO_PURCHASE=>'Unable to purchase', | |
DRIVE_BACK_HOME=>'Drive back home.' | |
]); | |
$smachine->fieldDefault=[ | |
'milk'=>0 | |
,'money'=>9999 | |
,'price'=>null | |
,'stock_milk'=>null | |
,'store_open'=>null | |
,'gas'=>10]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment