aboutsummaryrefslogtreecommitdiff
path: root/loopy.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-09-01 12:00:55 +0000
committerSimon Tatham <anakin@pobox.com>2005-09-01 12:00:55 +0000
commit643f468255f9f9fd16767f5f420c5db32e931b3b (patch)
treeadcb52371df4c089d28b0b684c50a1f2b3c8fa98 /loopy.c
parent04e26aaa7b04af90d8d42e77d3d9ccc1dade678c (diff)
downloadpuzzles-643f468255f9f9fd16767f5f420c5db32e931b3b.zip
puzzles-643f468255f9f9fd16767f5f420c5db32e931b3b.tar.gz
puzzles-643f468255f9f9fd16767f5f420c5db32e931b3b.tar.bz2
puzzles-643f468255f9f9fd16767f5f420c5db32e931b3b.tar.xz
Palm fixes for Loopy from James H: a #ifdef SLOW_SYSTEM, and an
int/long fix. [originally from svn r6256]
Diffstat (limited to 'loopy.c')
-rw-r--r--loopy.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/loopy.c b/loopy.c
index 1832ed9..4fa56e1 100644
--- a/loopy.c
+++ b/loopy.c
@@ -373,9 +373,14 @@ static game_params *default_params(void)
{
game_params *ret = snew(game_params);
+#ifdef SLOW_SYSTEM
+ ret->h = 4;
+ ret->w = 4;
+#else
ret->h = 10;
ret->w = 10;
- ret->rec = 0;
+#endif
+ ret->rec = 0;
return ret;
}
@@ -396,9 +401,11 @@ static const struct {
{ "7x7 Easy", { 7, 7, 0 } },
{ "7x7 Hard", { 7, 7, 2 } },
{ "10x10 Easy", { 10, 10, 0 } },
+#ifndef SLOW_SYSTEM
{ "10x10 Hard", { 10, 10, 2 } },
{ "15x15 Easy", { 15, 15, 0 } },
{ "30x20 Easy", { 30, 20, 0 } }
+#endif
};
static int game_fetch_preset(int i, char **name, game_params **params)
@@ -506,7 +513,7 @@ static char *validate_params(game_params *params, int full)
* light towards those with high scores */
struct square {
int score;
- int random;
+ unsigned long random;
int x, y;
};
@@ -538,10 +545,10 @@ static int square_sort_cmpfn(void *v1, void *v2)
return r;
}
- r = s1->random - s2->random;
- if (r) {
- return r;
- }
+ if (s1->random < s2->random)
+ return -1;
+ else if (s1->random > s2->random)
+ return 1;
/*
* It's _just_ possible that two squares might have been given