-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLTK_main.py
36 lines (26 loc) · 1.14 KB
/
LTK_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import LTK_board
from LTK_Exceptions import PlayerCountOutOfBounds
import LTK_configs
import logging
log = logging.getLogger('default')
def getPlayers():
players = input("Please enter how many players (4-10): ")
while True:
try:
players = int(players)
if players < 4 or players > 10:
raise PlayerCountOutOfBounds
break
except ValueError:
log.debug("ValueError on player input (couldn't be parsed into an int): {inp}".format(inp = players))
players = input("Did not enter a number. Please input a number between 4 and 10 and hit enter: ")
except PlayerCountOutOfBounds:
log.debug("Too low or too high number on player input: {inp}".format(inp = players))
players = input("Number was not an allowed number of players. Please input a number between 4 and 10 and hit enter: ")
return players
if __name__ == "__main__":
log.info("Getting player counts")
players = getPlayers()
log.info("Initializing board with {n} players".format(n = players))
board = LTK_board.board(players)
board.play()