Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Se ven todas las cartas en el juego #2

Open
mc-cari opened this issue Aug 16, 2023 · 0 comments
Open

Se ven todas las cartas en el juego #2

mc-cari opened this issue Aug 16, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@mc-cari
Copy link
Member

mc-cari commented Aug 16, 2023

Hola,

En teoría solo las últimas cartas de cada columna se ven, pero todas están visibles.

Lo más raro es que no se puede realizar ninguna jugada a pesar que están visibles (lo contrario a lo que índica el código) 🤔.

def can_move(self, sc, sr, tc):
# Todas visibles
cond_visible = self.is_visible_to_end(sc, sr)
# Secuencia cons secuencia de pinta
cond_suit_sequence = self.is_suit_sequence_to_end(sc, sr)
# Consecutivas
if len(self.cols[tc]) == 0:
cond_consecutive = True
else:
snum = self.cols[sc][sr].num
tnum = self.cols[tc][-1].num
cond_consecutive = tnum == snum + 1
valid = cond_visible and cond_suit_sequence and cond_consecutive
return valid
def is_visible_to_end(self, c, r):
visible = True
for card in self.cols[c][r:]:
visible = visible and card.visible
return visible

@benjavicente benjavicente added the bug Something isn't working label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants