2002-08-07 Duncan Mak <duncan@ximian.com>

* sample/Fifteen.cs: Fixed scramble. The whole thing works now.

svn path=/trunk/gtk-sharp/; revision=6493
This commit is contained in:
Duncan Mak 2002-08-07 05:44:03 +00:00
parent a15be41988
commit b2f1f53188
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2002-08-07 Duncan Mak <duncan@ximian.com>
* sample/Fifteen.cs: Fixed scramble. The whole thing works now.
2002-08-06 Rachel Hestilow <hestilow@ximian.com>
* generator/SignalHandler.cs: Handle null arguments and return values.

View file

@ -183,7 +183,7 @@ public class Fifteen
for (int i = 0; i < SCRAMBLE_MOVES; i++) {
retry:
int dir = rand.Next ();
int dir = rand.Next (4);
int x = 0, y = 0;
if ((dir == 0) && (position > 3)) // up
@ -194,8 +194,9 @@ public class Fifteen
x = -1;
else if ((dir == 3) && ((position % 4) != 3)) // right
x = 1;
else
else {
goto retry;
}
int old_position = position + y * 4 + x;
board [position] = board [old_position];