def turno(self):
        # Se ejecuta un turno del jugador
        # NO TESTEADA
        # print("\n" * 40)  # SACAR ESPACIOS
        print(self.mapa)
        print(self.anuncio)
        self.anuncio = ""
        in_turno = True
        while in_turno:
            print("""
            1. Seleccionar vehiculo (mover o atacar)

            2. Ingresar al radar

            3. Salir del juego """)

            opcion = f.manejo_opcion(["1", "2", "3"])

            if opcion == "1":
                in_turno = self.main_menu()
            elif opcion == "2":
                self.radar.menu()
            elif opcion == "3":
                sys.exit("Adios! Tu te lo pierdes ;) ")

        self.get_explorador().pasar_turno()
        self.turno_en_ataques()
        f.stop("ESTA LISTO CON SU TURNO, DEJE DE MIRAR PANTALLA")
Beispiel #2
0
    3. Salir del juego """)

    players = {}
    opcion = f.manejo_opcion(["1", "2", "3"])
    if opcion == "1":
        juego = Juego()
        opcion_ok = True
        players["1"] = input("\n Ingrese el nombre del Jugador 1: ")
        players["2"] = input("\n Ingrese el nombre del Jugador 2: ")
    elif opcion == "2":
        juego = Juego(maquina=True)
        players["1"] = input("\n Ingrese el nombre del Jugador 1: ")
        players["2 (M)"] = "SuperMachine"
    elif opcion == "3":
        sys.exit("Adios! Tu te lo pierdes ;) ")

    juego.posicionar_vehiculos()

    emp = juego.sorteo()
    print("\n" * 40)  # SACAR ESPACIOS
    print("Sorteo realizado exitosamente. ", end="")
    print("Empieza {0}, el Jugador {1} !".format(players[emp.id], emp.id))
    f.stop("\n\n\n JUGADOR {} CIERRE LOS OJOS!".format(juego.el_otro(emp).id))

    ter = juego.run(emp)

    print("\nGracias por jugar! Congrats again to {0}".format(players[ter.id]))

    print("\n  BATTLESHEEP, el ajedrez del futuro. \n")
Beispiel #3
0
def cargar_tableros(juego):
    num = [i for i in range(12)]
    for p in juego.players:
        mapa = [(p.vehiculos_mar, p.mapa.mar), (p.vehiculos_aire, p.mapa.aire)]
        for s in mapa:
            for v in s[0]:
                a = r.randint(0, 1)
                if a == 0:
                    v.girar()
                coor_ok = False
                while not coor_ok:
                    try:
                        coor = (r.choice(num), r.choice(num))
                        coor_ = s[1].check_coordenadas(coor, v)
                        coor_ok = True
                    except:
                        pass
                s[1].insertar_vehiculo(coor_, v)
        print(p.mapa)
    return juego


juego = Juego()  # aux
juego = cargar_tableros(juego)  # aux
emp = juego.sorteo()  # original
print("Empieza el Jugador {0} !".format(emp.id))  # original
f.stop("\n\n\n JUGADOR {} CIERRE LOS OJOS!".format(juego.el_otro(emp).id))
ter = juego.run(emp)  # original
print("\nGracias por jugar! Congrats again to P{0}".format(ter.id))  # original
print("\n  BATTLESHEEP, el ajedrez del futuro. \n")  # original
 def test_stop(self):
     with m.patch('builtins.input', side_effect=['a', 'c', 'd']):
         assert f.stop("mensaje")
         assert f.stop("mensaje")
         assert f.stop("mensaje")
Beispiel #5
0
 def test_stop(self):
     with m.patch('builtins.input', side_effect=['a', 'c', 'd']):
         assert f.stop("mensaje")
         assert f.stop("mensaje")
         assert f.stop("mensaje")