Skip to content

Solving result

rummikub_solver.ProposedSolution

Bases: NamedTuple

Proposed next move to make for a given game state.

Attributes:

Name Type Description
tiles Sequence[Tile]

What tiles to move from the rack to the table

sets Sequence[tuple[Tile, ...]]

What sets to form with rack tiles combined with table tiles

free_jokers int

Number of free jokers on the table.

tiles instance-attribute

tiles: Sequence[Tile]

What tiles to move from the rack to the table

sets instance-attribute

sets: Sequence[tuple[Tile, ...]]

What sets to form with rack tiles combined with table tiles

free_jokers class-attribute instance-attribute

free_jokers: int = 0

Number of free jokers on the table.

If this value is non-zero, the jokers where free to begin with and the solver was not able to find a better solution that utilised these jokers.

One scenario this can happen is if a player can place all their tiles from the rack on to the table in an initial meld, including a joker that becomes free once combined with other tiles on the table. Since the player has already won this is not an issue.

rummikub_solver.TableArrangement

Bases: NamedTuple

Possible arrangement for tiles on the table.

Includes a count of how many jokers are redundant (can be used freely).

Attributes:

Name Type Description
sets Sequence[tuple[Tile, ...]]

Table sets

free_jokers int

Number of free jokers on the table

sets instance-attribute

sets: Sequence[tuple[Tile, ...]]

Table sets

This is one possible arrangement of the tiles present on the table.

free_jokers instance-attribute

free_jokers: int

Number of free jokers on the table