Beispiel #1
0
 def player_black_move(int1, int2, int3, int4):
     print("player Black ")
     int1 = input("fila i ")
     int2 = input("columna i ")
     int3 = input("fila dest ")
     int4 = input("columna dest  ")
     moves.player_move(int1, int2, int3, int4, 0)
     return None
Beispiel #2
0
 def player_white_move():
     print("player White  ")
     int1 = int(input("fila i  "))
     int2 = int(input("columna i  "))
     int3 = int(input("fila dest  "))
     int4 = int(input("columna sdest  "))
     moves.player_move(int1, int2, int3, int4, 0)
     return None
Beispiel #3
0
def main(player1, player2):
    game_winner = False
    start_text = Style.Foreground.violet + "Let's get started!" + Style.end
    board_at_start = make_board(player1.pawn, player2.pawn, empty_cell)
    move = 1

    print("Hello players!")
    if_instructions = input("Would you like to see the instructions?\n"
                            "y/n\n")
    if if_instructions == "n":
        pass
    else:
        instructions()
    print(start_text)
    board = board_at_start
    while not game_winner:
        if (move % 2) == 0:
            playing_player = player2
        else:
            playing_player = player1
        print_board(board)
        board = player_move(playing_player, board)
        board = check_if_player_has_a_queen(playing_player, board)
        game_winner = check_if_player_won(player1, player2, board)
        move += 1
    print("Congratulations, " + game_winner.name + ", you won!!!! ")
    print(game_winner.color + """          o 
       o^/|\\^o
    o_^|\\/*\\/|^_o
   o\\*`'.\\|/.'`*/o
    \\\\\\\\\\\\|//////
     {><><@><><}
     `\"\"\"\"\"\"\"\"\"`""" + Style.end)
Beispiel #4
0
 def player_black_move():
     print("player Black ")
     int1= int(input("fila i  "))
     int2= int(input("columna i  "))
     int3= int(input("fila dest  "))
     int4= int(input("columna sdest  "))
     control = False
     control = test_numbers(int1,int2,int3,int4)
     if control == True:
         moves.player_move(int1,int2,int3,int4,"black")
         f = moves.game_board2[recentWmoves[2]][recentWmoves[3]]
         if  recentWmoves[2] == 0 and f == "P^" or f == "L^":
             if f == "P^":
                 moves.game_board2[recentWmoves[2]][recentWmoves[3]] = "Pc^"
                 moves.board_shogi(moves.game_board2)
                 player_white()
             if f == "L^":
                 moves.game_board2[recentWmoves[2]][recentWmoves[3]] = "Lc^"
                 moves.board_shogi(moves.game_board2)
                 player_white()
         elif  recentFF == 1 and f == "H^":
             moves.game_board2[recentWmoves[2]][recentWmoves[3]] = "Hc^"
             moves.board_shogi(moves.game_board2)
             player_white()
         elif f =="K^" or f == "G^":
             player_white()
         #elif recentFI == 6 or recentFI == 7 or recentFI == 8 or recentFF == 6 or recentFF == 7 or recentFF == 8:
         elif recentWmoves[0] == 0 or recentWmoves[0] == 1 or recentWmoves[0] == 2 or recentWmoves[2] == 0 or recentWmoves[2] == 1 or recentWmoves[2] == 2:
             print("desea promocionar la pieza que acaba de mover? Coloque 1 si es asi")
             control=int(input("coloque 0 o 1"))
             if control == 1:
                 f = f[0]
                 f = f + "c^"
                 moves.game_board2[recentWmoves[2]][recentWmoves[3]] = f
                 moves.board_shogi(moves.game_board2)
                 player_white()
             else:
                 player_white()
     else:
         print("invalid imput, pls try again")
         player_black_move()
     return None