tweaks to colouring

This commit is contained in:
Vincent Rodley 2025-08-13 10:50:42 +12:00
parent 24112abebb
commit 2aec7528be

20
main.py
View File

@ -29,7 +29,7 @@ def colourTile(tile):
elif tile == 'y': elif tile == 'y':
return f"{C.BOLD}{C.LIGHT_GREEN} Y {C.END}" return f"{C.BOLD}{C.LIGHT_GREEN} Y {C.END}"
else: else:
return " O " return " "
elif mode == "coloured_background": elif mode == "coloured_background":
if tile == 'R': if tile == 'R':
@ -44,12 +44,16 @@ def colourTile(tile):
return " " return " "
elif mode == "emojis": elif mode == "emojis":
if tile.lower() == 'r': if tile == 'R':
return "🔴" return "🔴"
elif tile.lower() == 'y': elif tile == 'r':
return ""
elif tile == 'Y':
return "🟡" return "🟡"
elif tile == 'y':
return "⚠️"
else: else:
return "" return " "
return tile return tile
@ -74,7 +78,8 @@ def printBoard(board):
if mode == "emojis": if mode == "emojis":
top = f""" {C.BOLD}CONNECT FOUR top = f""" {C.BOLD}CONNECT FOUR
======================{C.END}""" ======================{C.END}"""
bottom = f"{C.BOLD}==1==2==3==4==5==6==7=={C.END}" bottom = f"{C.BOLD}=1⃣=2⃣=3⃣=4⃣=5⃣=6⃣=7⃣={C.END}"
else: else:
top = f""" {C.BOLD}CONNECT FOUR top = f""" {C.BOLD}CONNECT FOUR
============================={C.END}""" ============================={C.END}"""
@ -370,7 +375,8 @@ def play_lan_client():
def play_vs_computer(): def play_vs_computer():
# play_game(cpu_move_provider, local_move_provider) # play_game(cpu_move_provider, local_move_provider)
play_game(local_move_provider, cpu_move_provider) # play_game(local_move_provider, cpu_move_provider)
play_game(cpu_move_provider, cpu_move_provider)
# =========================== # ===========================
# | Menu | # | Menu |
@ -462,7 +468,7 @@ while True:
print("2. PvP (LAN)") print("2. PvP (LAN)")
print("3. PvC (vs computer)") print("3. PvC (vs computer)")
print("4. Edit settings") print("4. Edit settings")
print("4. Quit") print("5. Quit")
choice = input("Choose 1-4: ").strip() choice = input("Choose 1-4: ").strip()
if choice == "1": if choice == "1":
play_local_pvp() play_local_pvp()