BUSCAMINAS 100%REAL NO FAKE

import random

matriz = []
jugadas = []
coins = 5
x = 1
row = 0
col = 0
puntaje = 0

for i in range(4):
    matriz.append([])
    for j in range(4):
        matriz[i].append(random.randint(0, 1))
        
print("Buscaminas")
#print(matriz)1

while x <= coins :
    valid = False
    
    print("\nJugadas restantes " + str(coins - x + 1))
    row = int(input("Ingrese fila: \n"))
    while row > 4 or row < 1 :
        print("No puede ser mayor de 4 y menor de 1 \n")
        row = int(input("Ingrese fila: \n"))
    col = int(input("Ingrese columna \n"))
    while col > 4 or col < 1:
        print("No puede ser mayor de 4 y menor de 1 \n")
        col = int(input("Ingrese fila: \n"))
    play = matriz[row - 1][col - 1]
    
    if (len(jugadas) == 0) :
        valid = True
    else :
        for k in range(len(jugadas)) :
            fila = jugadas[k][0] == row
            columna = jugadas[k][1] == col
            validate = fila and columna
            valid = not validate
            if (not valid) :
                break
             
    if valid == True : 
        jugadas.append([row,col])
        if (play == 0) :
            puntaje = puntaje - 2
        else :
            puntaje = puntaje + 4
    else :
        print("Por favor repita la jugada")
        coins = coins + 1
        
    #print("Puntaje parcial = " + str(puntaje))
    x = x + 1
    
print("Puntaje total: " + str(puntaje))
print(matriz)
print(jugadas)

Share this

Related Posts

Previous
Next Post »