Created
January 2, 2012 22:27
-
-
Save macintoxic/1552402 to your computer and use it in GitHub Desktop.
restore blocks
This file contains hidden or 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
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