Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 26, 2022 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/0a4f8fa9dfd01090c0ae8cee0dbbecb7 to your computer and use it in GitHub Desktop.
Save parzibyte/0a4f8fa9dfd01090c0ae8cee0dbbecb7 to your computer and use it in GitHub Desktop.
class Celda
{
private:
int x, y;
bool mina, descubierta;
public:
Celda(int x, int y, bool tieneMina)
{
this->x = x;
this->y = y;
this->mina = tieneMina;
this->descubierta = false;
}
void imprimir()
{
cout << "Celda en " << this->x << ", " << this->y << " con mina? " << this->mina << "\n";
}
bool establecerMina(bool tieneMina)
{
if (this->tieneMina())
{
return false;
}
else
{
this->mina = tieneMina;
return true;
}
}
bool tieneMina()
{
return this->mina;
}
bool estaDescubierta()
{
return this->descubierta;
}
void setDescubierta(bool descubierta)
{
this->descubierta = descubierta;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment