]> Pileus Git - ~andy/rhawk/commitdiff
Add starting bids message
authorAndy Spencer <andy753421@gmail.com>
Sat, 21 Nov 2015 23:33:23 +0000 (23:33 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 22 Nov 2015 21:51:08 +0000 (21:51 +0000)
spades.awk

index 175ff9f5b264860bd360ae97b638ae54b45fbd1a..d60507546a26de3e9a57e42a366dcc778ddf7045 100644 (file)
@@ -291,6 +291,15 @@ function sp_bidders(       i, turn, bid, bids)
        return bids
 }
 
+function sp_extra(     n, s)
+{
+       n = sp_bids[0] + sp_bids[1] + sp_bids[2] + sp_bids[3];
+       s = n == 12 || n == 14 ? "" : "s";
+
+       return n<13 ? "Playing with " 13-n " bag"   s "!" :
+              n>13 ? "Fighting for " n-13 " trick" s "!" : "No bags!";
+}
+
 function sp_score(     bids, times, tricks)
 {
        for (i=0; i<2; i++) {
@@ -715,6 +724,7 @@ sp_state == "bid" &&
                if (sp_turn != sp_dealer) {
                        sp_say(sp_player ": it is your bid! (" sp_bidders() ")")
                } else {
+                       sp_say(sp_extra() " (" sp_bidders() ")")
                        for (p in sp_players)
                                say(p, "You have: " sp_hand(p, p))
                        sp_state = "play"