Skip to content

Instantly share code, notes, and snippets.

@macintoxic
Created January 2, 2012 22:27
Show Gist options
  • Save macintoxic/1552402 to your computer and use it in GitHub Desktop.
Save macintoxic/1552402 to your computer and use it in GitHub Desktop.
restore blocks
void RestoreBlocks ()
{
int x;
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
if (GetVal (i, j) == 0) {
x = 5;
do {
//coloca valores aleatorios no campo evitando pontuar no inicio
SetFieldValue (i, j, Random.Range (1, ColorsAvailable));
} while (rowLineLength (i, j) > 2 || columnLineLenght (i, j) > 2 || x-- == 0);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment