| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-08-31 00:44:25 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-08-31 00:44:25 +0200 |
| commit | 0ebd88472a6bd195f2f5ff34165c7fa79053105d (patch) | |
| tree | 8488f24e7cb16c7ed589703361ce9604c317520a /data/examples/blackjack/global.fate | |
| parent | 23c5a3b1bd89e7a394a4cc4881e0764d601632c7 (diff) | |
Adds more list instr, Blackjack example.
Diffstat (limited to 'data/examples/blackjack/global.fate')
| -rw-r--r-- | data/examples/blackjack/global.fate | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/data/examples/blackjack/global.fate b/data/examples/blackjack/global.fate new file mode 100644 index 0000000..9c10c9f --- /dev/null +++ b/data/examples/blackjack/global.fate @@ -0,0 +1,36 @@ +(fate_version 1) + +(require player.fate) + +(global player player) + +(global (lambda text (int)) coins_word) + +(set coins_word + (lambda ((int i)) + (if_else (= (var i) 1) + (text a single coin ) + (text (var i) coins ) + ) + ) +) + +(declare_text_effect action_description) + +(define_sequence money_acquisition ((int amount)) + (set player.money (+ (var player.money) (var amount))) + (if (> (var amount) 0) + (text_effect action_description + You acquired (eval coins_word (var amount))! + ) + ) +) + +(define_sequence money_loss ((int amount)) + (set player.money (- (var player.money) (var amount))) + (if (> (var amount) 0) + (text_effect action_description + You lost (eval coins_word (var amount)). + ) + ) +) |


