Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- black = "\033[30m"
- green = "\033[32m"
- yellow = "\033[33m"
- red = "\033[31m"
- blue = "\033[34m"
- reset = "\033[0m"
- p1 = f"{red}◉ {reset}"
- p2 = f"{blue}◉ {reset}"
- # Default board reference
- d_board = ["0", "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", "35", "36", "37", "38", "39",
- "40", "41", "42", "43", "44", "45", "46", "47",
- "48", "49", "50", "51", "52", "53", "54", "55",
- "56", "57", "58", "59", "60", "61", "62", "63"]
- available_spots = ["1", "3", "5", "7",
- "8", "10", "12", "14",
- "17", "19", "21", "23",
- "25", "27", "29", "31",
- "32", "34", "36", "38",
- "41", "43", "45", "47",
- "48", "50", "52", "54",
- "57", "59", "61", "63"]
- # Realtime board and reset
- board = ["00", p2, "02", p2, "04", p2, "06", p2,
- p2, "09", p2, "11", p2, "13", p2, "15",
- "16", p2, "18", p2, "20", p2, "22", p2,
- "24", "25", "26", "27", "28", "29", "30", "31",
- "32", "33", "34", "35", "36", "37", "38", "39",
- "40", p1, "42", p1, "44", p1, "46", p1,
- p1, "49", p1, "51", p1, "53", p1, "55",
- "56", p1, "58", p1, "60", p1, "62", p1]
- def display_board():
- print(f"""■■■■■■■■■■■■■■■■■■■■■■■■■■■
- █ {board[0]} {board[1]} {board[2]} {board[3]} {board[4]} {board[5]} {board[6]} {board[7]} █
- █ {board[8]} {board[9]} {board[10]} {board[11]} {board[12]} {board[13]} {board[14]} {board[15]} █
- █ {board[16]} {board[17]} {board[18]} {board[19]} {board[20]} {board[21]} {board[22]} {board[23]} █
- █ {board[24]} {board[25]} {board[26]} {board[27]} {board[28]} {board[29]} {board[30]} {board[31]} █
- █ {board[32]} {board[33]} {board[34]} {board[35]} {board[36]} {board[37]} {board[38]} {board[39]} █
- █ {board[40]} {board[41]} {board[42]} {board[43]} {board[44]} {board[45]} {board[46]} {board[47]} █
- █ {board[48]} {board[49]} {board[50]} {board[51]} {board[52]} {board[53]} {board[54]} {board[55]} █
- █ {board[56]} {board[57]} {board[58]} {board[59]} {board[60]} {board[61]} {board[62]} {board[63]} █
- ■■■■■■■■■■■■■■■■■■■■■■■■■■■""")
- def check_for_win():
- return
- def switch_player():
- global current_player
- if current_player == p1:
- current_player = p2
- else:
- current_player = p1
- def check_for_win():
- return
- def input_turn():
- return
- def select_pawn():
- selection = input(f"{current_player}'s turn. Select a pawn: ")
- while True:
- if selection not in available_spots:
- selection = input(f"Invalid input. Choose between 1-63: ")
- continue
- elif board[int(selection)] != current_player:
- selection = input(f"choose a player")
- continue
- elif current_player == p1:
- if board[int(selection) - 7] in available_spots and board[int(selection) - 7] is p1 and board[int(selection) - 9] in available_spots and board[int(selection) - 9] is p1:
- selection = input(f"Your characters are infront of that pawn. Again: ")
- continue
- if board[int(selection) - 7] not in available_spots and board[int(selection) - 14] not in available_spots and board[int(selection) - 9] not in available_spots and board[int(selection) - 18] not in available_spots:
- selection = input(f"That pawn can't move. Try again: ")
- continue
- elif current_player == p2:
- if board[int(selection) + 7] not in available_spots and board[int(selection) + 14] not in available_spots and board[int(selection) + 9] not in available_spots and board[int(selection) + 18] not in available_spots:
- selection = input(f"That pawn can't move. Try again: ")
- continue
- else:
- break
- game_is_active = True
- current_player = p1
- display_board()
- while game_is_active:
- select_pawn()
- input_turn()
- display_board()
- check_for_win()
- switch_player()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement