소스 검색

require a minimum of 2 players

George C. Privon 8 년 전
부모
커밋
ec878b3170
2개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  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: