Created
March 10, 2018 00:05
-
-
Save parzibyte/8e715456c1f2ffc000f76c5c4e9b0329 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean esCoordenadaValida(String coordenadas, int &x, int &y) { | |
int indice = coordenadas.indexOf(","); | |
if (indice != -1) { | |
String supuestoX = coordenadas.substring(0, indice), | |
supuestoY = coordenadas.substring(indice + 1, coordenadas.length() - 2); | |
if (isNumeric(supuestoX) && isNumeric(supuestoY)) { | |
x = supuestoX.toInt(), y = supuestoY.toInt(); | |
return x >= 0 && y >= 0 && x < ANCHURA_LCD && y < ALTURA_LCD; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment