Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 26, 2022 16:27
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/0579552aea735f1a3b820d3e837998fb to your computer and use it in GitHub Desktop.
Save parzibyte/0579552aea735f1a3b820d3e837998fb to your computer and use it in GitHub Desktop.
string obtenerRepresentacionMina(int x, int y)
{
Celda c = this->contenido.at(y).at(x);
if (c.estaDescubierta() || this->modoProgramador)
{
if (c.tieneMina())
{
return "*";
}
else
{
int cantidad = this->minasCercanas(y, x);
string cantidadComoCadena = "";
stringstream ss;
ss << cantidad;
ss >> cantidadComoCadena;
return cantidadComoCadena;
}
}
else
{
return ".";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment