Ver Fonte

require a minimum of 2 players

George C. Privon há 8 anos atrás
pai
commit
ec878b3170
2 ficheiros alterados com 12 adições e 0 exclusões
  1. 8 0
      CHANGELOG.md
  2. 4 0
      cgame.py

+ 8 - 0
CHANGELOG.md

@@ -2,6 +2,14 @@
 
 ## 0.X Series
 
+### 0.1.2
+
+#### Bugfixes
+
+#### Enhancements
+
+* Require a minimum of 2 players
+
 ### 0.1.1
 
 #### Bugfixes

+ 4 - 0
cgame.py

@@ -123,6 +123,10 @@ class cgame:
             playerinput = input("Please list the IDs for the players in this game (in order of play): ")
             playerIDs = [int(x) for x in playerinput.split()]
 
+            if len(playerIDs) < 2:
+                _sys.stderr.write("Playing alone? You need at least one opponent!\n")
+                return 1
+
             for playerID in playerIDs:
                 matched = False
                 for dbplayer in dbplayers: