summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c11f195)
Initially, all words shown are just blanks. Then after words are
found they will be drawn on the next update, (which is not yet
being triggered).
#include "word-game.h"
#include "demo-item.h"
#include "word-game.h"
#include "demo-item.h"
+#define RACK_DICT_ENTRY_FOUND (1<<1)
#define MAX_TILES 7
typedef struct _tile
#define MAX_TILES 7
typedef struct _tile
double new_x, new_y;
cairo_move_to (cr, cursor->x, cursor->y);
double new_x, new_y;
cairo_move_to (cr, cursor->x, cursor->y);
- cairo_show_text (cr, word);
+ if (*entry & RACK_DICT_ENTRY_FOUND) {
+ cairo_show_text (cr, word);
+ } else {
+ int i, length = strlen (word);
+ for (i = 0; i < length; i++)
+ cairo_show_text (cr, "_");
+ }
cairo_get_current_point (cr, &new_x, &new_y);
if (new_x > cursor->max_column_width)
cursor->max_column_width = new_x;
cairo_get_current_point (cr, &new_x, &new_y);
if (new_x > cursor->max_column_width)
cursor->max_column_width = new_x;
if (event->keyval == GDK_Return) {
dict_entry_t *entry;
entry = dict_lookup (rack->solution, rack->guess);
if (event->keyval == GDK_Return) {
dict_entry_t *entry;
entry = dict_lookup (rack->solution, rack->guess);
- if (DICT_ENTRY_IS_WORD (entry))
+ if (DICT_ENTRY_IS_WORD (entry)) {
+ *entry = *entry | RACK_DICT_ENTRY_FOUND;
printf ("%s is good\n", rack->guess);
printf ("%s is good\n", rack->guess);
printf ("%s is not a word\n", rack->guess);
printf ("%s is not a word\n", rack->guess);
rack_return_all (rack);
return TRUE;
}
rack_return_all (rack);
return TRUE;
}