本文へ移動

Tsunagi繋ぎ

同じ印の2つを別々の線で結び、盤を埋めます。収録された問題やシード付きの問題で遊べます。

「つなぎ」は、物をつなぐことを表す言葉です。 名前について(英語)

目次

リファレンス

SVGの盤

import { … } from "@johnmorrisdotca/tsunagi/draw";

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

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

Tsunagi's drawing: a board as SVG text, with its colour sets, its boards, the style that gives the drawing its look, and where everything sits in it (so a page can tell which cell a finger is over). A separate entry (@johnmorrisdotca/tsunagi/draw), so a server that only checks an answer never loads any of it.

エクスポート

名前種類概要
beadShades関数A marble on a line's way between its ends: the pair's colour, or for numbers the line's own soft tint, with nothing written on it.
CELL定数How wide a cell is in the drawing's units.
cellAtPoint関数The cell under a point of the drawing, or null where there is none: off the board, in the frame, on a hexagon's missing corner.
colourOfPair関数The colour of a pair in a set, round and round.
COORDINATE_ROOM定数The room the row numbers and column letters take on every side, where they are drawn.
drawTsunagi関数A board as SVG text, with the lines in options.lines drawn on it.
drawTsunagiCode関数A level's layout code drawn, or an empty string for a code that is no layout at that size.
drawTsunagiMarble関数One marble on its own, as SVG text: for a legend or an icon.
drawTsunagiPair関数What one pair's line is made of in a drawing, for a page that keeps a drawing in its DOM and redraws only the pair whose line changed: its washes and its little marbles, each to go inside the group of that pair's (.tsu-washes > [data-pair] and .tsu-beads > [data-pair], and .tsu-ghosts > [data-pair] on a board that wraps), and its line (a .tsu-line for the .tsu-lines group, to replace any of that pair's).
FRAME定数The frame round the playing surface, in the drawing's units.
GeometryOptions型Coordinate labels and wrap ghost-cell choices for geometry.
HEX_RADIUS定数A hexagon's centre to its corner, in cells: a pointy-top hexagon one cell wide.
hexagonPoints関数A hexagon's corners about a centre, pointy at the top, as an SVG points list.
hsl関数A colour as a CSS string, lightened or darkened by shift percentage points, at an opacity.
lineColour関数The stroke a pair's line is drawn in: its colour, or a soft tint of it for numbers.
lineRuns関数A line as the runs it is drawn in, each a list of points through its cells' middles.
marbleShades関数A marble's shading: the highlight at its upper left, its body, and its rim, and the ink its number is written in.
PORTAL_STUB定数How far from the middle of a portal's cell a line stops going in, and starts coming out, as a share of a cell: just inside the ring.
portalMark関数The mark of portal index, from 0: its Greek letter, or its number once the letters are used up.
round関数A number as short as it can be written for a drawing: two places.
TSUNAGI_BOARD_NAMES定数The ready-made boards.
TSUNAGI_BOARDS定数Every ready-made board's look.
TSUNAGI_COLOUR_SET_NAMES定数The colour sets there are.
TSUNAGI_COLOUR_SETS定数Every set carries a colour for each of the eighty-two pairs a board can have (PAIR_LETTERS): its sixteen, which every board to 15×15 has been drawn in, then the same hues again turned round the colour wheel and made lighter or darker, round after round, so that no two pairs of a 30×30 board wear exactly one colour.
TSUNAGI_DEFAULT_BOARD定数The default: paper, which takes its colours from the page (--tsu-paper and the rest of TSUNAGI_STYLE), light or dark.
TSUNAGI_DEFAULT_COLOUR_SET定数The sets' default: the one itsutsu.com plays in.
TSUNAGI_PORTAL_COLOURS定数The colours and the marks of a board's portals: the two rings of a portal are drawn alike, in one of these colours and with one of these letters, so that they can be told from any other pair and from a marble.
TSUNAGI_PORTAL_GLYPHS定数The letters that mark portals: Greek, which no marble or number is.
TSUNAGI_SHELL定数The plain shell marble a number is written on: highlight, body, rim, and the ink.
TSUNAGI_STRINGS定数Native board words, with the same keys in every shipped language.
TSUNAGI_STYLE定数THE STYLE a Tsunagi drawing wears: the colours of its board as custom properties, the two things that move (a flashing ring round a marble Check found unjoined, and the burst where an explosion took a line out), and the one rule that matters for a puzzle played with fingers: nothing in the drawing can be selected, dragged or double-tapped.
tsunagiBoardLook関数A board as asked: a ready-made one by name, or a look of your own.
TsunagiBoardLook型What a board is made of: every part a CSS colour.
TsunagiBoardName型A supported named native board appearance.
TsunagiColour型A colour as hue (0 to 360), saturation and lightness (each 0 to 100).
tsunagiColourSet関数A colour set as asked: one of the named sets, or colours of your own (used round and round when a board has more pairs than you gave).
TsunagiColourSetName型A supported named palette for the native board.
TsunagiDrawOptions型DRAWING a board as SVG text: a string, to put in a page, a file or an image, with nothing to load and nothing run.
TsunagiFill型Marbles along every line (the dots), or the line alone.
tsunagiGeometry関数The geometry of a layout's drawing.
TsunagiGeometry型The board dimensions, cell centres and playable-cell mapping used by SVG and pointer input.
TsunagiLanguage型THE WORDS A TSUNAGI BOARD SAYS, in English and Japanese: what a screen reader hears of the drawing, the buttons and the lines under a playable board, and what each challenge on a level means.
tsunagiLanguageOf関数The language a piece of text is in: Japanese for anything starting ja, English for everything else.
TsunagiMarks型How the pairs are told apart: by colour, or by the number on each pair's marbles.
TsunagiPoint型A point in the drawing.
tsunagiSay関数A line in a language, with its values filled in; the line itself if there is none by that name.
washColour関数The faint wash a line leaves on the cells it runs through.

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

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