Struct

IpuzCell

Description [src]

struct IpuzCell {
  /* No available fields */
}

An opaque data type containing the information for an individual IpuzGrid cell.

Cells are always created by a IpuzGrid and aren’t meant to exist independently.

Representation

Cells are found in three fundamental types as defined by IpuzCellType:

Cells also have a number of fields associated with them. They are:

  • number: The number associated with the cell
  • label: An alternative to number, in string form
  • solution: The target answer for the puzzle
  • initial val: A string representing a pre-filled value.

The inline images above indicate how a cell could be rendered for crossword-style puzzles. However, Each puzzle kind defines how the types fields are interpreted. Not every puzzle kind uses every value. Please see the Representation section located in each class’s documentation for more information.

As an example of how things can vary, for IpuzCrossword the number field refers to the clue number associated with that cell (as shown above). For sudoku puzzles, it’s the number solution in the grid. It is never used with IpuzAcrostic or IpuzNonogram puzzles.

Info

Since cells are semantically undefined, the IpuzCell setters don’t do any type of validation. It is very possible to get a cell into a state that is undefined for a given puzzle kind. As an example, setting the label on a cell with a cell_type of IPUZ_CELL_NULL is undefined in all known puzzle kinds.

Cells keep a reference to the styles and clues associated to them. It’s possible to look these up by calling ipuz_cell_get_clue() and ipuz_cell_get_style() respectively.

Warning

Cells don’t automatically maintain the styles or clues associated with them. When modifying a puzzle, care must be taken to keep these in sync with the rest of the puzzle. The _fix() functions generally do this.

Instance methods

ipuz_cell_build
No description available.

ipuz_cell_clear_clue_direction
No description available.

ipuz_cell_clear_clues
No description available.

ipuz_cell_equal

Compares two cells and returns TRUE if they are identical.

ipuz_cell_get_cell_type

Returns the IpuzCellType of cell.

ipuz_cell_get_clue
No description available.

ipuz_cell_get_initial_val
No description available.

ipuz_cell_get_label
No description available.

ipuz_cell_get_number
No description available.

ipuz_cell_get_saved_guess
No description available.

ipuz_cell_get_solution
No description available.

ipuz_cell_get_style
No description available.

ipuz_cell_get_style_name
No description available.

ipuz_cell_parse_puzzle
No description available.

ipuz_cell_parse_solution
No description available.

ipuz_cell_ref

Refs the cell.

ipuz_cell_set_cell_type

Sets the cell type of cell to be cell_type.

ipuz_cell_set_clue
No description available.

ipuz_cell_set_initial_val
No description available.

ipuz_cell_set_label
No description available.

ipuz_cell_set_number
No description available.

ipuz_cell_set_saved_guess

Sets a user guess for a cell for cell.

ipuz_cell_set_solution
No description available.

ipuz_cell_set_style

Sets the style for a given cell. As a convenience, it’s possible to set the style_name at the same time.

ipuz_cell_set_style_name
No description available.

ipuz_cell_unref

Unrefs cell, which will be freed when the reference count reaches 0.