Class
IpuzPuzzleInfo
Description [src]
final class Ipuz.PuzzleInfo : GObject.Object
{
/* No available fields */
}
IpuzPuzzleInfo provides a snapshot of statistics and
meta information of an IpuzPuzzle. It can only be created
through calling ipuz_puzzle_get_puzzle_info(), and should
not be independently created.
The snapshot it provides is static: It does not update after any modifications to the puzzle. If the puzzle is changed in any substantial way, the info would have to be regenerated to be valid.
Usage
g_autoptr (IpuzPuzzle) puzzle = NULL;
g_autoptr (IpuzPuzzleInfo) info = NULL;
IpuzCharset *clue_lengths;
puzzle = ipuz_puzzle_new_from_file ("example.ipuz", NULL);
info = ipuz_puzzle_get_puzzle_info (puzzle);
g_print ("example.ipuz has %u pangrams\n", ipuz_puzzle_info_get_pangram_count (info));
clue_lengths = ipuz_puzzle_info_get_clue_lengths (info);
for (guint i = 0; i < ipuz_charset_get_n_chars (clue_lengths); i++)
{
IpuzCharsetValue value;
ipuz_charset_get_value (clue_lengths, i, &value);
g_print ("There are %u clues of length %u\n", value.count, value.c);
}
g_print ("Settability bucket: %u\n", ipuz_puzzle_info_get_settability_bucket (info));
Instance methods
ipuz_puzzle_info_get_charset
Returns an IpuzCharset representing valid characters
associated with the puzzle.
ipuz_puzzle_info_get_clue_lengths
Returns an IpuzCharset containing the lengths of all the
clues associated with the puzzle. This abuses charsets a little bit
as the lengths are cast to gunichars.
ipuz_puzzle_info_get_pangram_count
Returns the number of distinct, possible pangrams within a puzzle.
ipuz_puzzle_info_get_settability_bucket
Returns the settability factor of the puzzle. This is an
interpretation of the settability score suitable for presentation
to a user. See IpuzSettabilityBucket for more details.
ipuz_puzzle_info_get_settability_score
Returns the settability score of the puzzle. This score is a number between 0.0 and 100.0 that gives a sense of how difficult it is to fill a given grid.
ipuz_puzzle_info_get_solution_chars
Returns an IpuzCharset containing all the solution
characters associated with the puzzle.
ipuz_puzzle_info_get_unches
In crossword vernacular, an unch is an unchecked cell in a puzzle. That is to say, a white square that is part of only one answer (either across or down, but not both).
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.