Skip to content

Instantly share code, notes, and snippets.

@kaini
Created January 5, 2011 10:40
Show Gist options
  • Save kaini/766153 to your computer and use it in GitHub Desktop.
Save kaini/766153 to your computer and use it in GitHub Desktop.
// Schwerkraft nach unten ↓
for (int col = 0; col < game.Field.GetLength(1); ++col)
{
int count = 0;
for (int row = game.Field.GetLength(0) - 1; row >= 0; --row)
{
if (game.Field[row, col] == ' ')
{
++count;
}
else
{
if (count != 0)
{
game.Field[row + count, col] = game.Field[row, col];
game.Field[row, col] = ' ';
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment