| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-09-13 18:13:55 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-09-13 18:13:55 +0200 |
| commit | 121042f223430aeab262634ecc59f86f08a35dc5 (patch) | |
| tree | 65524661bd6e88c0d6c5088f083fae4b1b9b5bf8 /data | |
| parent | ee3d8bbc6edd9832da94daec092936f067953cdb (diff) | |
Gets the Blackjack example to run again.
Diffstat (limited to 'data')
| -rw-r--r-- | data/examples/blackjack/cards.fate | 16 | ||||
| -rw-r--r-- | data/examples/blackjack/main.fate | 2 | ||||
| -rw-r--r-- | data/examples/blackjack/play.fate | 19 |
3 files changed, 21 insertions, 16 deletions
diff --git a/data/examples/blackjack/cards.fate b/data/examples/blackjack/cards.fate index 2312f03..fa2d9f5 100644 --- a/data/examples/blackjack/cards.fate +++ b/data/examples/blackjack/cards.fate @@ -41,7 +41,7 @@ ) ) - (add (var c) (at deck)) + (add! (var c) (at deck)) ) ) @@ -52,10 +52,10 @@ (global (list card) deck_template) -(add_all heart_cards deck_template) -(add_all spade_cards deck_template) -(add_all diamond_cards deck_template) -(add_all club_cards deck_template) +(add_all! heart_cards deck_template) +(add_all! spade_cards deck_template) +(add_all! diamond_cards deck_template) +(add_all! club_cards deck_template) (define_sequence shuffle_into_deck ( @@ -74,8 +74,8 @@ (set d (rand 0 (- (size (at deck)) 1))) ) - (add_at (var d) (access (at cards) (var o)) (at deck)) - (remove_at (var o) (at cards)) + (add_at! (var d) (access (at cards) (var o)) (at deck)) + (remove_at! (var o) (at cards)) ) ) @@ -90,7 +90,7 @@ (define_sequence draw_a_card (((ptr (list card)) deck) ((ptr card) result)) (set (at result) (access (at deck) 0)) - (remove_at 0 (at deck)) + (remove_at! 0 (at deck)) ) (define_sequence compute_score (((ptr (list card)) deck) ((ptr int) result)) diff --git a/data/examples/blackjack/main.fate b/data/examples/blackjack/main.fate index 0b5acf8..0ab9b7d 100644 --- a/data/examples/blackjack/main.fate +++ b/data/examples/blackjack/main.fate @@ -13,7 +13,7 @@ Welcome to Tonkadur's wonderful and totally original blackjack! Say, I don't think I've seen you before... No, no, I am sure I haven't, actually. -(prompt_string player.name 1 64 What's your name, then?) +(prompt_string (ptr player.name) 1 64 What's your name, then?) Alright, (var player.name), well, since it's your first time here, let me give you some coins. Just between you and me, someone left those laying around, they aren't mine. diff --git a/data/examples/blackjack/play.fate b/data/examples/blackjack/play.fate index 8504afa..3dc9536 100644 --- a/data/examples/blackjack/play.fate +++ b/data/examples/blackjack/play.fate @@ -30,7 +30,12 @@ (done) ) ) - (prompt_integer bet 1 (var player.money) How much would you like to bet?) + (prompt_integer + (ptr bet) + 1 + (var player.money) + How much would you like to bet? + ) (text_effect action_description The dealer shuffles the cards and starts dealing. ) @@ -40,7 +45,7 @@ (visit generate_shuffled_deck (ptr current_deck)) (visit draw_a_card (ptr current_deck) (ptr new_card)) - (add (var new_card) player.hand) + (add! (var new_card) player.hand) (text_effect action_description You have been dealt the (var new_card.name). @@ -49,7 +54,7 @@ (visit draw_a_card (ptr current_deck) (ptr new_card)) - (add (var new_card) dealer_hand) + (add! (var new_card) dealer_hand) (text_effect action_description The dealer has drawn the (var new_card.name). @@ -57,7 +62,7 @@ ) (visit draw_a_card (ptr current_deck) (ptr new_card)) - (add (var new_card) player.hand) + (add! (var new_card) player.hand) (text_effect action_description You have been dealt the (var new_card.name). @@ -67,7 +72,7 @@ (newline) (visit draw_a_card (ptr current_deck) (ptr new_card)) - (add (var new_card) dealer_hand) + (add! (var new_card) dealer_hand) (text_effect action_description The dealer has drawn a card, face down. @@ -182,7 +187,7 @@ (local int player_score) (visit draw_a_card (ptr current_deck) (ptr new_card)) - (add (var new_card) player.hand) + (add! (var new_card) player.hand) (visit compute_score (ptr player.hand) (ptr player_score)) @@ -260,7 +265,7 @@ (local card new_card) (visit draw_a_card (ptr current_deck) (ptr new_card)) - (add (var new_card) dealer_hand) + (add! (var new_card) dealer_hand) (text_effect action_description The dealer has drawn the (var new_card.name). |


