mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-05-12 07:22:18 +00:00
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:
parent
a15be41988
commit
b2f1f53188
|
@ -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>
|
2002-08-06 Rachel Hestilow <hestilow@ximian.com>
|
||||||
|
|
||||||
* generator/SignalHandler.cs: Handle null arguments and return values.
|
* generator/SignalHandler.cs: Handle null arguments and return values.
|
||||||
|
|
|
@ -183,7 +183,7 @@ public class Fifteen
|
||||||
|
|
||||||
for (int i = 0; i < SCRAMBLE_MOVES; i++) {
|
for (int i = 0; i < SCRAMBLE_MOVES; i++) {
|
||||||
retry:
|
retry:
|
||||||
int dir = rand.Next ();
|
int dir = rand.Next (4);
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
|
|
||||||
if ((dir == 0) && (position > 3)) // up
|
if ((dir == 0) && (position > 3)) // up
|
||||||
|
@ -194,8 +194,9 @@ public class Fifteen
|
||||||
x = -1;
|
x = -1;
|
||||||
else if ((dir == 3) && ((position % 4) != 3)) // right
|
else if ((dir == 3) && ((position % 4) != 3)) // right
|
||||||
x = 1;
|
x = 1;
|
||||||
else
|
else {
|
||||||
goto retry;
|
goto retry;
|
||||||
|
}
|
||||||
|
|
||||||
int old_position = position + y * 4 + x;
|
int old_position = position + y * 4 + x;
|
||||||
board [position] = board [old_position];
|
board [position] = board [old_position];
|
||||||
|
|
Loading…
Reference in a new issue