This commit is contained in:
NikolajDanger
2020-07-30 12:55:48 +02:00
parent df1c5f4196
commit 2717ea20c1

View File

@ -18,9 +18,9 @@ def fourInARowStart(channel):
draw4InARow.drawImage(channel)
return "Started game", True
return "Started game", True, False
else:
return "There's already a 4 in a row game going on in this channel", False
return "There's already a 4 in a row game going on in this channel", False, False
# Places a piece at the lowest available point in a specific column
def placePiece(channel : str,player : int,column : int):
@ -45,11 +45,11 @@ def placePiece(channel : str,player : int,column : int):
json.dump(data,f,indent=4)
draw4InARow.drawImage(channel)
return "Placed the piece", True
return "Placed the piece", True, True
else:
return "There isn't any room in that column", True
return "There isn't any room in that column", True, True
else:
return "There's no game in this channel", False
return "There's no game in this channel", False, False
# Parses command
@ -59,8 +59,8 @@ def parseFourInARow(command, channel, user):
elif command.startswith(" place"):
commands = command.split(" ")
try:
return placePiece(channel,int(commands[2]),int(commands[3])-1), True
return placePiece(channel,int(commands[2]),int(commands[3])-1)
except:
return "I didn't quite get that", False, True
return "I didn't quite get that", False, False
else:
return "I didn't get that", False, True
return "I didn't get that", False, False