Skip to the content

Kyuubu documentation

Kyuubu API: every export

Every export of every entry point, each with its own page. This page keeps the addresses the old one-page reference had.

@johnmorrisdotca/kyuubu/react

Kyuubufunction

THE CUBE AS A REACT COMPONENT: a thin wrapper round CubeView, which does the work.

KyuubuHandletype

What a parent can ask of the cube on the screen.

KyuubuMovesfunction

THE MOVES AS A REACT COMPONENT: a thin wrapper round mountMoveList.

KyuubuMovesPropstype

The props of KyuubuMoves: every option of the list, and the box's className and style.

KyuubuPropstype

The component's props: every option of CubeView, a state the parent may keep, and the box's className, style and data-*.

@johnmorrisdotca/kyuubu/famous

FAMOUS_SOLVESconstant

The famous solves, the newest record first.

famousSolvefunction

One famous solve by its id, or undefined.

@johnmorrisdotca/kyuubu/player

mountPlayerfunction

A solve drawn in an element, with its controls.

PLAYER_CSSconstant

The player's stylesheet, put in the page once.

PlayerOptionstype

How a player is set up: the solve, and how it is shown.

@johnmorrisdotca/kyuubu/element

@johnmorrisdotca/kyuubu/element/define

@johnmorrisdotca/kyuubu/cuboid

CUBOID_RANDOM_STATE_MAXconstant

The most states a cuboid has and still has its scramble drawn uniformly out of all of them.

CuboidDimstype

The width, height and depth of a cuboid, in cubies: each a whole number from 1 to 7.

cuboidDragAnglefunction

The angle, in degrees, a picked layer has been dragged to: forwards is positive, and it stops at a half turn either way.

CuboidDragPicktype

The layer a drag has picked: its axis and layer, the way across the screen (a unit vector, x right and y down) that turns it forwards by the right-hand rule, and whether it can only be turned by a half turn.

CuboidFacetype

One face of a cuboid: how many columns and rows of stickers it has as it is seen from outside, and where its stickers begin in the state.

cuboidFaceMovefunction

A face turned, depth layers in from it (1 is the face itself), on this cuboid: the move, or why not.

cuboidFacesfunction

The six faces of a cuboid, in the order the state is written, with their size and where each begins.

CuboidFaulttype

Why a piece of notation is not a move on this cuboid.

CuboidKeyReadingtype

What a key means on a cuboid: a turn, a depth for the next face letter, or nothing.

cuboidLayerOffunction

The layer, 0 to the axis's depth − 1 from its negative side, that a cubie centre sits in.

CuboidLineReadingtype

What reading a line gives: its moves, or the first piece that is not one, where it began (counted in characters from 0) and why.

cuboidMiddleMovefunction

The middle layer of an odd side, turned as M, E or S: the move, or why not.

CuboidMovetype

One turn of a layer: its axis, its layer from the axis's negative side (0 to the axis's depth − 1), and one, two or three quarter turns by the right-hand rule.

cuboidMoveForReleasefunction

The move a release makes: the picked layer turned by those quarters, or null for none.

cuboidMoveLegalfunction

Whether a move can be made on this cuboid: its layer exists, is not the whole puzzle, and its turn is one that layer may make.

cuboidMoveNamefunction

What a move of a cuboid turns, in a few plain words, in English or Japanese: R2 is "Right face, twice", 2U2 "Up layer 2, twice", M2 "Middle slice, twice".

cuboidMoveNotationfunction

A move as a person writes it on this cuboid: R, R', R2, 2U2, M2.

cuboidNamefunction

A cuboid's name as it is written: 2×3×3.

cuboidPastCommitfunction

Whether a held layer is past its point of no return: letting go now, at rest, makes a move.

cuboidPermutationOffunction

Where every sticker goes under a legal turn: to[i] is the slot the sticker in slot i lands on.

cuboidPresetfunction

The named cuboid with this key, or undefined.

CuboidPresettype

THE NAMED CUBOIDS: the shapes people know, each with a name, the way it is best seen, and a line on what makes it different.

cuboidQuartersForReleasefunction

What letting go makes of a dragged layer, as quarter turns from −2 to 2, where 0 is back where it was.

CuboidReadingtype

What reading one piece of notation gives: the move, or why it is not one.

CuboidReplayFaulttype

Why a cuboid replay could not be planned: which text would not read, where and why.

CuboidReplayPlantype

A cuboid solve ready to be played: a ReplayPlan whose size is the longest side, with the puzzle's own dims.

cuboidScrambleLengthfunction

How many turns a random walk that scrambles a cuboid has: 8, and 2.2 for every layer that is not the whole puzzle, up to 100.

cuboidSlotsfunction

Every sticker slot of a cuboid, in the order its state is written, and the way back from a slot to its place.

cuboidSolvedfunction

SOLVED: every face one colour, whichever colour it is, so a cuboid solved and then turned whole in the hand is still solved.

CuboidWordstype

THE CUBOID'S OWN WORDS, in English and Japanese: what a screen reader calls it and what is said when a move cannot be made.

faultSaysfunction

The line that says why a piece of notation is not a move on a cuboid.

HALF_TURN_COMMITconstant

The point of no return of a half turn, in degrees: the middle of the way round.

halfTurnOnlyfunction

Whether a layer turns only by a half turn: it has a slice that is not square.

hasRandomStateScramblefunction

Whether a cuboid has few enough states to be scrambled to one drawn uniformly out of all of them.

isCuboidDimsfunction

Whether this is a cuboid the package makes: three whole numbers from 1 to 7, and not 1×1×1, which has nothing to turn.

isCuboidStatefunction

Whether a string is a state of a cuboid this size: the right length, and each face's letter as many times as the face has stickers.

legalTurnsfunction

The turns a layer can make: [1, 2, 3] where its slice is square, [2] where it is not, and none where there is no such layer or the layer is the whole puzzle.

parseCuboidDimsfunction

A cuboid read from 2x3x3, 2×3×3, 2 3 3 or 2,3,3: its dims, or null where it is not one the package makes.

parseCuboidMovefunction

One piece of notation as a move, or null where it is not one on this cuboid.

parseCuboidMovesfunction

A line of notation as moves, or null where any of it is not a move on this cuboid.

pickCuboidDragfunction

The layer a drag across a sticker means, once it can be told: null while the pointer has not gone far enough, while the two layers that carry the sticker are too nearly as likely as each other, or where neither can turn.

readCuboidKeyfunction

What a key means on a cuboid, given the depth a digit before it set (1 where none did): the cube's keys (readKey) without the turns of the whole cube.

readCuboidMovefunction

One piece of notation read for this cuboid: R, R', R2, 2R', M2.

readCuboidMovesfunction

A line of notation read for this cuboid, saying which piece is wrong and why where one is.

sameCuboidfunction

Whether two cuboids are the same puzzle turned about in the hand: the same three sides in any order.

sliceOffunction

The two axes a layer across axis is a slice of, and so what its slice measures: the other two sides.

turnCuboidfunction

The state after one turn; an illegal turn throws a RangeError.

@johnmorrisdotca/kyuubu/cuboid/draw

CuboidViewEventstype

What a cuboid tells the listeners on adds: a turn a person made, with the stickers after it; and the view turned, in degrees.

@johnmorrisdotca/kyuubu/cuboid/play

CUBOID_PLAYER_CSSconstant

The player's stylesheet, put in the page once: the cube player's, under the same class names and custom properties.

mountCuboidPlayerfunction

A solve on a cuboid drawn in an element, with its controls.

@johnmorrisdotca/kyuubu/cuboid/element

@johnmorrisdotca/kyuubu/cuboid/element/define

@johnmorrisdotca/kyuubu

algorithmNamefunction

The name of one of the method's algorithms, as a person would say it: "Three corners round", 「コーナーの三点交換」.

CliResulttype

What the command line came to: the exit code, and what goes to standard output and standard error.

CliWordstype

The command line's words: its help, its refusals and what it reports.

Clothtype

A cloth's name.

clothVarsfunction

A cloth as CSS variables; nothing for a name that is not a cloth, so the defaults stay.

COMMIT_ANGLEconstant

The point of no return, in degrees, where none is given: let go short of it and the layer goes back.

countsAsMovefunction

Whether a move counts towards a solve's moves: a turn of the whole cube in the hand does not.

countSolveMovesfunction

How many of the steps count as moves: every turn, and no turn of the whole cube.

CUBE_FACE_ORDERconstant

The faces in the order a state is written: up, right, front, down, left, back.

CUBE_OPTIONSconstant

Every choice the package offers, grouped, with what each is called in each way of making a cube.

CUBE_OPTIONS_LEFT_OUTconstant

What is not a choice, by the way of making a cube that has it and its name there, each with why: a function, a value that is itself the state, a list that needs a program to write.

CUBE_SCALE_INTERACTIVEconstant

What a cube drawn at each scale is, apart from its width: a small one is for looking at, so it is not turned by a hand or a key unless asked.

CUBE_SCALE_PXconstant

How wide each is, in pixels: a cube is as tall as it is wide.

CUBE_SCALESconstant

HOW BIG A CUBE IS DRAWN, as a setting: small for a list or a picker, medium, and large.

CubeAxistype

An axis of the cube: 0 is x (to the right), 1 is y (up) and 2 is z (towards the viewer).

CubeFacetype

A face's letter: U, R, F, D, L or B.

CubeMovetype

One turn: a layer, or the whole cube, turned about an axis by one, two or three quarter turns.

cubeNetfunction

The cube unfolded flat, as lines of text: the top above the front, the left, front, right and back in a row, and the bottom below.

cubeSlotsfunction

Every sticker slot of a cube of this size, in the order its state is written, and the way back from a slot to its place.

CubeThemetype

How a cube looks: its six colours, its plastic, and the shape of a sticker.

CubeTurnstype

One, two or three quarter turns, counter-clockwise seen from the axis's positive end.

CubeViewEventstype

What a cube tells the listeners on adds: a turn a person made, with the stickers after it; and the view turned, in degrees.

CubeViewOptionstype

Everything a cube on the screen can be told when it is made.

cubeWidthPxfunction

The width in pixels a cube is drawn at: width when it is a number above zero, and otherwise the scale's.

CubeWordstype

THE WORDS THE CUBE ITSELF SAYS, in English and Japanese: what a screen reader calls it, whether it is solved, the names of the steps of a solve and what each is for, and the names of the method's algorithms.

decodeCubeMovesfunction

The moves written in a code, or null where any of it is not a move.

DEFAULT_COLOURSconstant

The standard colours, by the letter a solved face carries: white up, red right, green front, yellow down, orange left, blue back.

DEFAULT_PLASTICconstant

The colour of the plastic between the stickers, where none is given.

DRAG_CLEAR_RATIOconstant

How much more one layer must go the pointer's way than the other to be picked before that.

DRAG_DECIDE_PXconstant

How far it goes before a drag that could be either of two layers picks the likelier anyway.

DRAG_START_PXconstant

How far the pointer goes, in pixels, before a drag picks a layer at all.

dragAnglefunction

The angle, in degrees, a picked layer has been dragged to: forwards is positive, and it stops at a half turn either way.

dragHintfunction

The drag that makes this turn, from the way the cube is looked at now (view, as viewMatrix makes it).

DragHinttype

What to drag to make a turn of one layer, or of several about one axis as one (a wide turn).

DragPicktype

The layer a drag has picked: its axis and layer, and the way across the screen (a unit vector, x right and y down) that turns it forwards by the right-hand rule.

encodeCubeMovesfunction

Moves written three characters each, such as x23y02z*1: compact, and readable without knowing the cube's size.

FACE_FRAMESconstant

Which way each face looks, and its rows and columns as the face is seen from outside, in the order above.

FACE_PROPERTIESconstant

The CSS custom property that colours each face, where no colour is given in code: set it on the cube's element or any ancestor.

faceMovefunction

A face turned, depth layers in from it (1 is the face itself), on a cube of this size; null where the cube has no such layer.

faceOfSlotfunction

The face letter a solved cube shows at this slot.

fillfunction

A line of a table with its braces filled in: fill("A {n}×{n} cube", { n: 3 }) is "A 3×3 cube".

FLICK_ANGLEconstant

The least a flick must have turned the layer, in degrees.

FLICK_SPEEDconstant

A flick: the layer still turning this fast the drag's own way, in degrees a millisecond, when the pointer lets go.

fromJSONfunction

The solves in a JSON export, or null where the text is not one: not JSON, not this format, or a later one.

fromTextfunction

A solve read back from plain lines, or null where they are not one.

FULL_SCRAMBLE_LENGTHSconstant

The lengths official competitions scramble each size to, near enough: what a "full" scramble means here.

Guideclass

A guide through a list of moves or the method's steps, for a cube of side n starting from state.

GUIDE_CSSconstant

The guide's stylesheet, put in the page once.

GuideHeardtype

What a guide made of a turn it was told of: the movement finished, part of it made, a detour, or a detour taken back by hand.

GuidePanelOptionstype

How a guide beside a cube is set up: what it walks, and how it speaks.

GuideSourcetype

What a guide walks: moves as written ("R U R' U'", wide turns and rotations read as parseSolve reads them), or as moves, each a movement; or the layer-by-layer method, step by step from the cube as it is (2×2 and 3×3).

GuideSteptype

The movement a guide asks for now.

HINT_MIN_FACINGconstant

How squarely a face must face the viewer for an arrow to be drawn on it: the cosine of its angle to the eye.

HINT_MIN_FOLLOWconstant

How closely a drag along the arrow must go the way the layer turns: the cosine between them.

HintArrowtype

The arrow a hint draws, in the cube's doubled units (a sticker is 2 across), lying on a face.

isClothfunction

Whether a text names a cloth.

isCubeScalefunction

Whether a value is one of the three scales.

isCubeStatefunction

Whether a string is a state of a cube this size: the right length, and the right number of every colour.

joinTurnsfunction

Turns of one layer in a row written as one, and any that come to nothing left out: "U' U2" is "U", "U' U" is nothing.

KeyReadingtype

What a key means: a turn, a depth for the next face letter, or nothing.

KYUUBU_CLOTHSconstant

THE CLOTHS A PLAYER'S STAGE MAY BE LAID IN: the same five the whole family offers, and itsutsu.com's boards: green, blue, red, black and wood.

KyuubuStringstype

Every word the package says: the cube's and the command line's.

languageOffunction

The language a tag names, as far as the package speaks it: anything beginning "ja" is Japanese, and the rest is English.

layerOffunction

The layer, 0 to n − 1 from the axis's negative side, that a cubie centre sits in.

Mat3type

A 3×3 matrix, rows of three.

MAX_CLI_COUNTconstant

The most scrambles the command line makes at once.

MAX_CLI_LENGTHconstant

The longest scramble the command line will make.

MAX_RECORD_MOVESconstant

The most turns one record may hold, scramble and solve each.

MAX_RECORD_SIZEconstant

The largest cube a record may be of: the package is made and tested for 2×2 to 7×7.

MAX_RECORDSconstant

The most solves read from one file.

middleMovefunction

The middle layer of an odd cube, turned as M, E or S; null on an even cube, which has none.

mountGuidefunction

A guide drawn in an element, for the cube in view: the view shows the hint, and a person makes each movement on it.

MOVE_LIST_CSSconstant

The list's stylesheet, put in the page once.

moveFitsfunction

Whether a move can be made on a cube of this size.

moveForDragfunction

The turn a drag across a sticker means: the layer that carries it most nearly the way the pointer went, that way.

moveForReleasefunction

The move a release makes: the picked layer turned by those quarters, or null for none.

moveForWheelfunction

The turn the wheel means over a sticker.

MoveListGrouptype

A run of moves under a heading: a scramble, a solution.

MoveListItemtype

One move of a list: its code, what it turns in words (worked out from the code when left out), and the name a screen reader gives its button (the code and the words when left out).

movementSaysfunction

A movement in plain words, for a cube held with its front towards you: "Turn the right face away from you.", 「右の面を奥に回します。」.

movementTextfunction

A movement in notation: one layer as moveNotation writes it; several layers from a face inwards, about one axis and as far, as a wide turn (Rw, 3Rw'); anything else as its moves one after another.

moveNamefunction

What a move turns, in a few plain words, in English or Japanese; null for anything that is not a move in standard form.

moveNotationfunction

A move as a person writes it, for a cube of this size.

movesForReleasefunction

Every layer a release turns: the picked layer, and the one beside it where the drag took a seam, each by those quarters; none for none.

movesNotationfunction

Moves as a person writes them, a space between each.

nextTurnfunction

One random layer, a quarter or a half turn either way, never about the axis the last one used, so it never undoes or joins it.

NotationFaulttype

Why a line of notation could not be read, and where.

OptionGrouptype

What the choices are gathered under, in the order a page shows them.

OptionKindtype

How a choice is made: a number in a range, on or off, one of a few, a colour, or text (moves are text with notation in it).

paceSecondsfunction

Seconds for a pace given as a number or a name; the default for anything else.

parseMovefunction

One move read back from the notation, for a cube of this size, or null where it is not one: R, R', R2, 2R', M2, x'.

parseMovesfunction

A line of notation read back, or null where any of it is not a move on this cube.

parseSolvefunction

A solve, or a scramble, read from the way it is written, for a cube of this size.

parseSolveMovefunction

One written step read for a cube of this size, or why it is not one.

pastCommitfunction

Whether a dragged layer is past the point of no return: letting go now, at rest, makes a move.

permutationOffunction

Where every sticker goes under one turn: to[i] is the slot the sticker in slot i lands on.

pickDragfunction

The layer a drag across a sticker means, once it can be told: null while the pointer has not gone far enough, or while the two layers that carry the sticker are too nearly as likely as each other.

planReplayfunction

A scramble and a solve read, checked and timed.

quartersForReleasefunction

What letting go makes of a dragged layer: the quarter turns it snaps to, from −2 to 2, where 0 is back where it was and no move at all.

quarterTurnfunction

A quarter turn counter-clockwise, seen from the axis's positive end.

randomScramblefunction

A scramble of length turns, each of one layer chosen at random, never two in a row about the same axis, so no turn undoes or joins the one before it and the count is the count.

readKeyfunction

What a key means on a cube of side n, given the depth a digit before it set (1 where none did).

Replayclass

A planned solve played on a cube: play, pause, a step either way, anywhere by seek, faster or slower, once or over and over.

REPLAY_LOOP_REST_MSconstant

How long a looped replay rests on the solved cube before it begins again, in milliseconds.

REPLAY_SCRAMBLE_STEP_MSconstant

How long each turn of the scramble takes when the replay walks through it, in milliseconds.

REPLAY_SCRUB_MSconstant

How long each turn made by moving the slider takes, in milliseconds.

REPLAY_SCRUB_TURNSconstant

How many turns moving the slider shows one by one: a longer jump goes straight to this many steps short of where it is going, and turns the rest.

REPLAY_SPEEDSconstant

The speeds a replay offers: the solve's own pace, half, a quarter and a tenth of it.

REPLAY_STEP_MSconstant

How long a step takes when the solve gives no time of its own, in milliseconds.

ReplayClocktype

The clock a replay runs by; the page's own unless a test gives another.

ReplayCubetype

The part of a cube's view a replay needs: CubeView is one.

ReplayFaulttype

Why a replay could not be planned: which text would not read, and where.

ReplayPlantype

A solve ready to be played: read, checked and timed.

rotationHintfunction

WHICH WAY TO TURN THE WHOLE CUBE: no drag on a sticker makes it (a key or a button does: x, y, z), so there is no sticker to take hold of, but the way it goes can still be drawn.

rotationKeysfunction

The key or keys that make a turn of the whole cube: X, Shift+X, X X.

runClifunction

The whole command line.

SCRAMBLE_SHORTESTconstant

The shortest wait it allows, in seconds: faster is a blur, and a page that asks for it gets this.

Scrambledtype

What the loop turns: the cube on the screen has all of it.

ScramblePagetype

The part of a page the loop listens to: a Document is one.

scrubPathfunction

What moving the slider from one position of a solve to another turns: the steps between, forwards when going on and each one undone, last first, when going back.

ScrubPathtype

The turns that take a cube from one position of a solve to another, for a slider that turns the cube as it moves.

Seamtype

A seam a hand has taken hold of: a turn about this axis would carry the layer the sticker is in and the one beside it, together.

SEAM_BANDconstant

How near a seam between two layers a touch lands to take both: this share of a sticker's width on each side of the line between them, so that the middle of a sticker, and a little more than half of its width, is still the one layer.

seamsAtfunction

The seams a touch at this place on a sticker is taking hold of, nearest first: where it lands within SEAM_BAND of a sticker's width of the line that parts the sticker's layer from the one beside it, along either of the two directions the sticker can be turned across.

seededRandomfunction

A SEEDED RANDOM SOURCE: the same seed gives the same numbers, in the same order, on every device and in every version from 1.1.0 on.

SolveAlgorithmtype

The name of one of the method's algorithms: a key of SOLVE_ALGORITHMS.

SolveMovetype

One thing a solver did: a turn, a wide turn or a turn of the whole cube.

solveMovesfunction

Every layer a list of steps turns, in order: what turnAll takes.

SolveParttype

A part of a step: turns to line something up, or one of the method's algorithms.

SolveReadingtype

What reading a solve gives: its steps, or the first thing that could not be read.

SolveRecordtype

One solve: the cube's size, the scramble that mixed it, and the turns made after.

SolveStagetype

The stages of the method, in the order they are done.

SolveSteptype

One step of a solve: its stage, the turns that do it, and the parts they come in.

solveStepsfunction

The layer-by-layer solve of a 2×2 or 3×3 in this state, as steps a person can follow, or null for a size the method is not written for.

SolveSummarytype

What a record comes to, worked out from its turns.

solveTextfunction

The steps written out in standard form, a space between each.

stageNamefunction

The name of a step of the solve, as a person would say it: "White cross", 「白のクロス」.

stageSaysfunction

What a step of the solve is for, in a sentence: "Make a yellow cross on the top."

StickerSlottype

Where one sticker slot sits: its cubie's centre and the direction it faces.

STRINGSconstant

The package's words in both languages.

summarizefunction

A record's scramble and turns in notation, the cube before and after, whether it ended solved, and its count of moves.

toCSVfunction

A list of solves as CSV, for a spreadsheet: a header, then a row a solve, with lines ended CRLF as RFC 4180 has them.

toJSONfunction

One solve or many, as JSON: { "format": 1, "generator": "kyuubu 1.1.0", "solves": [ … ] }.

toTextfunction

A solve as a few plain lines, to paste in a chat or a note:

turnAllfunction

The state after every turn in order.

turnCubefunction

The state after one turn.

undoAllfunction

A list of moves undone, last first.

undoOffunction

The move that takes this one back.

Vec3type

A point in the cube's doubled coordinates: a cubie's centre is a whole even or odd step from the middle, by the cube's size.

VERSIONconstant

The package's version, as in package.json.

viewMatrixfunction

The way the viewer looks at the cube: turned about the model's y (yaw), then tipped about the screen's x (pitch), in degrees.

wholeMovefunction

The whole cube turned in the hand, as x, y or z.

WORDSconstant

The cube's words in both languages.