Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /balance <account> 400
- /overdraft <account> 100
- /savings-rate <account> 0.1
- /balance <savings-account> 0
- $ account.balance
- 400
- /withdraw <account> 100
- -->
- /balance <savings-account> 10
- /balance <account> 290
- /withdraw <account> 300
- -->
- /balance <savings-account> 40
- /balance <account> -40
- /withdraw <account> 100
- -->
- ! Insufficient Funds !
- /withdraw <account> 60
- -->
- /balance <account> -100
- /balance <savings-account> 40
- $ account.available-balance
- 60
- --------------------------------------------------------------------------------
- /available-balance= <account> _.balance + _.overdraft
- /reaction= <account.withdraw> (/balance= <account> _.available-balance - $input)
- /reaction.before= <account.withdraw>
- ($input > 0) False:(Error("Don't you want any money?"))
- /reaction.before= <account.withdraw>
- (_.available-balance > 0) False:(Error("You're broke"))
- /reaction.before= <account.withdraw>
- ((_.available-balance - $input) > 0) False:(Error("Insufficient Funds"))
- /reaction.after <account.withdraw>
- Let('savings', ($input * _.savings-rate));
- ((_.available-balance - savings) > 0)
- True: ((/balance= <savings-account> _.balance + savings);
- (/balance= <account> _.balance - savings))
- --------------------------------------------------------------------------------
- /left <rect> 0
- /top <rect> 0
- /width <rect> 40
- /height <rect> 10
- /right= <rect> _.left + _.width
- /bottom= <rect> _.top + _.height
- /repr= <rect> "Rectangle((%s, %s), (%s, %s))" % (_.left, _.top, _.right, _.bottom)
- /width <rect> 17
- $ rect.repr
- Rectangle(0, 0, 17, 10)
- /left <rect> 25
- $ rect.repr
- Rectangle(25, 0, 42, 10)
Add Comment
Please, Sign In to add comment