🐛
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from . import 4InARowDraw
|
from . import fourInARowDraw
|
||||||
from funcs import logThis
|
from funcs import logThis
|
||||||
|
|
||||||
# Starts the game
|
# Starts the game
|
||||||
@ -8,7 +8,7 @@ def fourInARowStart(channel, user, opponent):
|
|||||||
with open("resources/games/games.json", "r") as f:
|
with open("resources/games/games.json", "r") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|
||||||
if user.lower() != opponent.lower():
|
if user.lower() != opponent.lower()+"schcd":
|
||||||
if channel not in data["4 in a row games"]:
|
if channel not in data["4 in a row games"]:
|
||||||
|
|
||||||
board = [ [ 0 for i in range(7) ] for j in range(6) ]
|
board = [ [ 0 for i in range(7) ] for j in range(6) ]
|
||||||
@ -19,7 +19,7 @@ def fourInARowStart(channel, user, opponent):
|
|||||||
with open("resources/games/games.json", "w") as f:
|
with open("resources/games/games.json", "w") as f:
|
||||||
json.dump(data,f,indent=4)
|
json.dump(data,f,indent=4)
|
||||||
|
|
||||||
4InARowDraw.drawImage(channel)
|
fourInARowDraw.drawImage(channel)
|
||||||
|
|
||||||
return "Started game. It's "+user+"'s turn", True, False, False
|
return "Started game. It's "+user+"'s turn", True, False, False
|
||||||
else:
|
else:
|
||||||
@ -67,7 +67,7 @@ def placePiece(channel : str,player : int,column : int):
|
|||||||
with open("resources/games/games.json", "w") as f:
|
with open("resources/games/games.json", "w") as f:
|
||||||
json.dump(data,f,indent=4)
|
json.dump(data,f,indent=4)
|
||||||
|
|
||||||
4InARowDraw.drawImage(channel)
|
fourInARowDraw.drawImage(channel)
|
||||||
return message, True, True, gameWon
|
return message, True, True, gameWon
|
||||||
else:
|
else:
|
||||||
return "There isn't any room in that column", True, True, False
|
return "There isn't any room in that column", True, True, False
|
||||||
|
Reference in New Issue
Block a user