Whisk (Whisk v0.0.2) View Source

A twisty puzzle scramble generator.

Examples

iex> Whisk.scramble("3x3")
"L F2 U R D B U2 R F' R F R2 D2 B R' B' D R B U"

iex> Whisk.scramble("2x2", length: 12)
"R2 F R' U2 F R U2 R2 F2 R F2 U2"

Link to this section Summary

Types

A string representation of a puzzle type.

A scramble is string representing a sequence of moves, separated by spaces.

Functions

Returns a list of supported puzzle types.

Generate a scramble for a puzzle type.

Link to this section Types

Specs

puzzle_type() :: String.t()

A string representation of a puzzle type.

Currently supported values are:

  • "2x2"
  • "3x3"

Specs

scramble() :: String.t()

A scramble is string representing a sequence of moves, separated by spaces.

Moves are also strings. Different puzzle types have different valid moves.

Link to this section Functions

Returns a list of supported puzzle types.

Link to this function

scramble(puzzle_name, opts \\ [])

View Source

Specs

scramble(puzzle_type(), list()) :: scramble()

Generate a scramble for a puzzle type.

Passing an unsupported puzzle type will generate an error.

Options

  • :length - the number of moves in the scramble