From a1e0a43307e56fcc5ea4e0d24aa737412af43b5d Mon Sep 17 00:00:00 2001 From: dgw Date: Fri, 24 Jul 2015 00:53:19 -0700 Subject: [PATCH] Grammar when printing card counts for who's next --- unobot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/unobot.py b/unobot.py index 2616f9e..6c01252 100644 --- a/unobot.py +++ b/unobot.py @@ -63,7 +63,7 @@ 'YOUR_CARDS': "Your cards (%d): %s", 'NEXT_START': "Next: ", 'SB_START': "Standings: ", - 'SB_PLAYER': "%s (%s cards)", + 'SB_PLAYER': "%s (%d %s)", 'D2': "%s draws two and is skipped!", 'CARDS': "Cards: %s", 'WD4': "%s draws four and is skipped!", @@ -292,8 +292,9 @@ def render_counts(self, full=NO): plr = len(self.players) - 1 arr = [] while plr != stop: - arr.append(STRINGS['SB_PLAYER'] % (self.playerOrder[plr], len( - self.players[self.playerOrder[plr]]))) + cards = len(self.players[self.playerOrder[plr]]) + g_cards = "card" if cards == 1 else "cards" + arr.append(STRINGS['SB_PLAYER'] % (self.playerOrder[plr], cards, g_cards)) plr += inc if plr == len(self.players) and not full: plr = 0