A(Great-Hexagonal,grid_new_greathexagonal,3,3) \
A(Octagonal,grid_new_octagonal,3,3) \
A(Kites,grid_new_kites,3,3) \
- A(Floret,grid_new_floret,1,2)
+ A(Floret,grid_new_floret,1,2) \
+ A(Dodecagonal,grid_new_dodecagonal,2,2) \
+ A(Great-Dodecagonal,grid_new_greatdodecagonal,2,2)
#define GRID_NAME(title,fn,amin,omin) #title,
#define GRID_CONFIG(title,fn,amin,omin) ":" #title
((field) &= ~(1<<(bit)), TRUE) : FALSE)
#define CLUE2CHAR(c) \
- ((c < 0) ? ' ' : c + '0')
+ ((c < 0) ? ' ' : c < 10 ? c + '0' : c - 10 + 'A')
/* ----------------------------------------------------------------------
* General struct manipulation and other straightforward code
{ 5, 5, DIFF_HARD, 6, NULL },
{ 5, 5, DIFF_HARD, 7, NULL },
{ 3, 3, DIFF_HARD, 8, NULL },
+ { 3, 3, DIFF_HARD, 9, NULL },
+ { 3, 3, DIFF_HARD, 10, NULL },
#else
{ 7, 7, DIFF_EASY, 0, NULL },
{ 10, 10, DIFF_EASY, 0, NULL },
{ 7, 7, DIFF_HARD, 6, NULL },
{ 5, 5, DIFF_HARD, 7, NULL },
{ 5, 5, DIFF_HARD, 8, NULL },
+ { 5, 4, DIFF_HARD, 9, NULL },
+ { 5, 4, DIFF_HARD, 10, NULL },
#endif
};
g = params->game_grid;
for (; *desc; ++desc) {
- if (*desc >= '0' && *desc <= '9') {
+ if ((*desc >= '0' && *desc <= '9') || (*desc >= 'A' && *desc <= 'Z')) {
count++;
continue;
}
grid *g;
game_state *state = snew(game_state);
game_state *state_new;
+ int count = 0;
params_generate_grid(params);
state->game_grid = g = params->game_grid;
g->refcount++;
* preventing games smaller than 4x4 seems to stop this happening */
do {
add_full_clues(state, rs);
+ if (++count%100 == 0) printf("tried %d times to make a unique board\n", count);
} while (!game_has_unique_soln(state, params->diff));
state_new = remove_clues(state, rs, params->diff);
int i;
game_state *state = snew(game_state);
int empties_to_make = 0;
- int n;
+ int n,n2;
const char *dp = desc;
grid *g;
int num_faces, num_edges;
assert(*dp);
n = *dp - '0';
+ n2 = *dp - 'A' + 10;
if (n >= 0 && n < 10) {
state->clues[i] = n;
+ } else if (n2 >= 10 && n2 < 36) {
+ state->clues[i] = n2;
} else {
n = *dp - 'a' + 1;
assert(n > 0);
* on that. We check this with an assertion, in case someone decides to
* make a grid which has larger faces than this. Note, this algorithm
* could get quite expensive if there are many large faces. */
-#define MAX_FACE_SIZE 8
+#define MAX_FACE_SIZE 12
for (i = 0; i < g->num_faces; i++) {
int maxs[MAX_FACE_SIZE][MAX_FACE_SIZE];
grid *g = state->game_grid;
grid_face *f = g->faces + i;
int x, y;
- char c[2];
+ char c[3];
- c[0] = CLUE2CHAR(state->clues[i]);
- c[1] = '\0';
+ if (state->clues[i] < 10) {
+ c[0] = CLUE2CHAR(state->clues[i]);
+ c[1] = '\0';
+ } else {
+ sprintf(c, "%d", state->clues[i]);
+ }
face_text_pos(ds, g, f, &x, &y);
draw_text(dr, x, y,