本文へ移動

Suido水道

管を回してポンプと排水口をつなぎます。収録された問題やシード付きの問題で遊べます。

「水道」は、水を届ける設備を表す言葉です。 名前について(英語)

目次

リファレンス

管・ルール・解法

import { … } from "@johnmorrisdotca/suido";

最小化と gzip 圧縮をしたサイズは 46.1 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Pipe masks, board codes, water flow, game state, bounded solvers and seeded puzzle generation.

エクスポート

名前種類概要
armsOf関数How many sides a piece opens on.
BIG_FAMILIES定数The families of BIG_SHAPES, each with how many shapes it holds, in the order they first appear there.
BIG_KIND_LIST定数Every kind of big piece, in the order the generator draws them, with how often each is drawn.
BIG_KINDS定数THE BIG PIECES: squares of four cells that are one piece (Layout.bigs).
BIG_MIXES定数The mixes a generator draws a plate from, plainest first.
BIG_PIECES_LARGEST定数The most, which scores full marks for size: a board of 20×20.
BIG_PIECES_SMALLEST定数The fewest pieces the water goes through that count for anything: a board of 5×5.
BIG_SCORE_WEIGHTS定数The weight of the size in the score, and of the tangle; they add to 1.
BIG_SHAPES定数Every big piece there is, up to turning (BigShape): 699, ordered by how many pipes they hold, then how many openings they have, then family.
BigKind型The name of a kind of big piece.
bigKindOf関数Which kind of big piece four masks make, and the fewest quarters clockwise from facing north that bring it to them; null for four masks that are none of the five.
bigMasksOf関数The masks of a big piece's four cells (clockwise from the top left) once it has been turned quarters quarters clockwise from facing north.
BigMix型Which big pieces a generator draws from, from the plainest to every one there is:
BigOnBoard型One big piece on a board: its top left cell, which of the 699 shapes it is, and how many quarters clockwise from the shape's own facing it is turned.
bigScoreOf関数How hard a board is across the set, 1 to 100: a whole number.
BigShape型EVERY BIG PIECE THERE CAN BE.
bigShapeById関数The shape with this id, or undefined for four masks that make none.
bigShapeOf関数Which shape four masks make, and the fewest quarters clockwise from the shape's own facing (BigShape.masks) that bring it to them; null for four masks that are none of the 699: a blank cell, a ring, a pipe with no opening to the outside.
bigShapesIn関数The big pieces of a board and which shape each is, read from masks (one for every cell of the board, as a board's pieces or an answer's stand): the board's pieces for the facing it starts in, an answer's for the facing the water needs.
blendBigScore関数The score of a board of used pieces whose tangle (exactDifficultyOf, 1 to 100 among boards of its size) is tangle, before it is rounded.
blendOf関数The blend of a board's five percentiles against reference, 0 to 1, before it is ranked among the blends.
Block型A block: its anchor (top left cell), whether it is a big piece, and its four cells clockwise from the top left.
blockAt関数The block a cell is in, or null.
blockCells関数The four cells of the block whose top left cell is anchor, clockwise from it.
blockFacings関数Every distinct way a block can face, as the four masks of its cells (in Block.cells order), the turn of 0 quarters first.
blockInfo関数The blocks of a board and the block each cell is in; read once for a layout and kept.
BlockInfo型The blocks of a board, in the order of their anchors, and which block each cell is in (-1 for none).
blockQuartersBetween関数How many quarters clockwise, 0 to 3, make the block's pieces in from the ones in to; null when no turn does.
canTurn関数Whether a piece can be turned into a new facing: ground, and a cross, look the same turned any way.
canTurnAt関数Whether a tap on cell of a game turns anything.
canTurnBlock関数Whether turning a block changes anything: a block of four crosses, or four pieces that look alike all round, never does.
cellChar関数A cell's character: its piece, marked as a source or a drain if it is one.
checkSuidoAnswer関数Whether an answer solves a board: the check a page makes to say "solved" and a server makes before it trusts a solve.
countSolutions関数How many answers there are, counted up to limit.
coverageOf関数The share of a board's pieces the water goes through in an answer, 0 to 1: 1 for a network, which the water reaches every piece of.
decodeLayout関数The board a code stands for, or null when it is not one: a bad size, an unknown character, a source or drain on bare ground, or no source at all.
deduce関数The deductions of a board, in rounds.
Deduction型What a player can work out without guessing, as a person would: look at every piece, fix what is forced, and look again.
DIFFICULTY_SIDES定数The sizes (side of the board) there is a reference set for.
DIFFICULTY_WEIGHTS定数The weights of the measures in the blend, for each kind.
difficultyOf関数How hard a board is, 1 to 100 among boards of its size, from the board as given and one of its answers.
EAST定数The east opening bit of a pipe mask.
encodeLayout関数The code of a board.
exactBigScoreOf関数How hard a board is across the set, 1 to 100, before it is rounded: what the levels are put in order by.
exactDifficultyOf関数The same before it is rounded to a whole number, from 1 to 100: the order boards are put in.
exactScoreOf関数The score of a measure against a reference set before it is rounded, from 1 to 100: what boards are put in order by, so that two boards of one whole score still have an order.
Flow型Where the water is on a board as it is turned: the whole picture, from the pump outwards.
flowOf関数The water on a board whose pieces face as masks say.
flowOfGame関数The water on a game.
Game型A game in play: the board as it was given, how every piece faces now, and how far each has been turned in all (kept as a count rather than a facing, so a drawing can turn a piece the way it was tapped, never the long way round).
gameCode関数The game as a code, every piece facing as it does now: what to keep to come back to it, and what to send to be checked.
gameFromCode関数A game from a board's code and the code of the board as it was left (gameCode): every piece facing as the kept code says, with the fewest quarters clockwise that get each there.
gameFromProgress関数The game a board's code and a kept gameProgress make, or null when the code is not a board or the progress is not one of that board's.
gameProgress関数A game half played, as a short string to keep: one digit for each piece (the quarter turns clockwise it has had from the way the board gave it, 0 to 3; the four pieces of a block have the digit of the block), a colon, and the number of taps made.
GuidePiece型One piece of the guide.
guidePieceById関数The entry with this id, or undefined.
guidePiecesOf関数The pieces of one group, in the order of the guide.
hasBlocks関数Whether a board has any block.
hintFor関数A piece to turn, for a player who asks for help: the first piece that does not face as answer says, nearest the pump first (the water's own order), or null when every piece does.
inBigMix関数Whether a shape belongs to a mix of the shapes (BigMix, not five).
isGameSolved関数Whether the game is solved: the same test the check makes of an answer.
isJoinedInside関数Whether the inside of a big piece is as it must be: wherever two of its cells meet, either both open towards each other or neither does.
isLocked関数Whether a piece is locked on this board.
isSolved関数Whether a board facing as masks say is solved.
isTwisted関数Whether a board has any twist.
Kind型What a board asks of the water.
Layout型A board.
laySuido関数A board laid out and turned at random, with no promise about how many answers it has: the raw material makeSuido shapes.
Made型A new board: its code, the code of its one answer, and what it was made from.
MadeScored型A new board with how hard it is.
MakeOptions型What a new board may be asked for.
makeSuido関数Makes a board with exactly one answer and says how hard it is.
makeUnscored関数Makes a board that has exactly one answer.
MAX_SIDE定数The largest side a board may have.
Measure型What is measured of one board.
MEASURE_NAMES定数The measures, in the order the reference lists them.
MeasureName型The measures, by name.
measureSuido関数Every measure of one board, from the board as given and one of its answers.
neighboursOf関数Which cell is next to each cell on each side: table[cell * 4 + side], or -1 where there is no cell (the edge of a board that does not wrap) or a wall.
newGame関数A game on a board, with every piece as given.
NORTH定数A side of a cell.
opposite関数The side a piece next door must open on to meet an opening on side side.
percentileIn関数Where value stands among sorted quantiles, 0 to 1: how far through them it is, by the share of the way between neighbours.
PIECE_GROUPS定数The groups, in the order a guide shows them.
PieceGroup型A GUIDE TO EVERY PIECE.
placeAfter関数Where the piece that stood in cell when the board was given is now, once its block has been turned quarters times clockwise.
placeBlocks関数Places blocks on a board of width by height, where near is the table of neighbours with no walls (neighboursOf): bigs big pieces, each of a kind drawn at random facing a way that has no opening off the edge of the board, and turning blocks that turn as one.
Placed型A block placed on a board by the generator: kind is a kind of BIG_KINDS or the id of a BigShape, and null for a block that turns as one.
quantilesOf関数Quantiles of a list of numbers, at points even steps from least to greatest, for a reference set.
quartersBetween関数The fewest quarter turns, clockwise, that make from into to; null when they are not the same shape.
Random型A number in [0, 1), like Math.random, from a stream a seed fixes.
Reference型A reference set of boards, as quantiles: every measure at 21 even steps from its least to its greatest, and the blend of the five at 101.
referenceFor関数The reference set a board is scored against: that of the board's side (the square root of its cells, to the nearest size there is a set for), kind and wrap.
referenceKey関数The key a reference set is kept under.
rotationsOf関数Every way a piece can face, each once and in order: one for a cross, two for a straight, four for the rest.
sameBlock関数Whether two cells of a board are in the same block.
scoreOf関数The score of a measure against a reference set: 1 (the plainest of its size) to 100.
seededRandom関数A stream of numbers in [0, 1) fixed by a seed.
Shape型What a piece is, by how many sides it opens on and where.
SHAPE_MASKS定数A piece of each shape facing north, as the drawings and the tests name them.
shapeOf関数The shape of a piece, from the sides it opens on.
shuffled関数A copy of the list in a random order (Fisher–Yates); the list given is left alone.
SIDE_STEPS定数The step across each side, as columns and rows.
SIDES定数The four sides by number, 0 (north) to 3 (west): the bit of side i is 1 << i.
sizeTermOf関数How big a board is for scoring, 0 to 1: the pieces its answer uses, on a log scale from BIG_PIECES_SMALLEST to BIG_PIECES_LARGEST.
solve関数Counts the answers to a board, up to limit, stopping early when budget positions have been looked at.
SolveResult型What the solver found.
SOUTH定数The south opening bit of a pipe mask.
SUIDO_BIG_FAMILIES_GUIDE定数ONE BIG PIECE OF EACH FAMILY.
SUIDO_LEVEL_TWISTS定数The six twists the fixed levels have, in the order they teach them.
SUIDO_PIECE_GUIDE定数EVERY PIECE, with a picture to draw it by.
SUIDO_TWISTS定数Every twist, the six the fixed levels teach in the order they teach them, then the two of boards made on request.
SuidoCheck型What a check says: solved, or the first reason it is not.
symmetryKey関数A board's identity up to turning and mirroring it: the smallest of the codes of its eight turns and mirrors, with every piece the water does not go through (it may face any way) set to one facing.
tapsBetween関数The taps it takes to face a piece the right way when a tap turns it one way only (both false) or either way (both true, the shorter of the two).
tapsToAnswer関数The fewest taps that would turn every piece to face as answer says, when a tap turns a piece either way (both, the default) or clockwise only.
transformLayout関数A board's cells, pumps, drains, locks, walls and blocks moved by one of the eight turns and mirrors: op 0 to 3 turn it a quarter at a time, 4 to 7 do so after a mirror.
turn関数A piece turned quarters quarter turns clockwise; a negative number turns it the other way.
turnAt関数A tap: the piece on cell turned a quarter, clockwise (by 1) or the other way (by -1); a cell in a block turns the whole block, its pieces moving round to the next cell as they turn.
turnBlock関数The pieces of a board after a block is turned by quarters clockwise (a negative number turns it the other way): the piece in each cell of the block moves round to the next and turns with the block.
turnedToFaceAt関数What a Hint does: the piece at cell turned clockwise, as many taps as it takes, to face as answer says; a block, the whole block, whichever of its cells is named.
turnsFromAnswer関数The turns a board needs, when taps turn a piece either way: how far it is from solved.
Twist型THE TWISTS: what a board can ask of a player beyond turning every piece until the water reaches all of them.
twistsOf関数The twists a board has, in the order the levels teach them: none for a plain board.
usedPiecesOf関数How many pieces the water goes through in an answer.
VERSION定数The package's version.
WEST定数The west opening bit of a pipe mask.
withMasks関数The same board with its pieces facing as masks says, which is how a half-played board or an answer is kept.

ソースを見るGitHub で編集@johnmorrisdotca/suido 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。