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

Revisar #1

Open
filevich opened this issue Oct 6, 2023 · 0 comments
Open

Revisar #1

filevich opened this issue Oct 6, 2023 · 0 comments

Comments

@filevich
Copy link
Member

filevich commented Oct 6, 2023

En

class Mano():
  def __init__(self) -> None:
    self.resultado      :Resultado         = None
    self.ganador        :str               = ""
    self.cartas_tiradas :list[CartaTirada] = []

  def to_dict(self) -> Dict[str, any]:
    return {
      "resultado": str(self.resultado) if self.resultado is not None 
              else str(Resultado.GANO_ROJO),
      "ganador": self.ganador,
      "cartasTiradas": [t.to_dict() for t in self.cartas_tiradas] \
        if len(self.cartas_tiradas) else None,
    } 
  
  def agregar_tirada(self, c:CartaTirada) -> None:
    self.cartas_tiradas += [c]

No debería ser if len(self.cartas_tiradas) else [] ? Cómo está en Go?

No debería ser self.resultado:Resultado = Resultado.INDETERMINADO ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant