本文へ移動

Tsunagi繋ぎ

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

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

目次

リファレンス

遊べる盤

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

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

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

Tsunagi, played in a page: mountTsunagi draws a level into any element and plays it by touch and mouse, with Undo, Restart, Check and Cheat, the zoom pad for big boards, and the words in English and Japanese. A separate entry (@johnmorrisdotca/tsunagi/play), so a server never loads any of it.

エクスポート

名前種類概要
edgeNudge関数How far to move a zoomed view in a frame, for a finger at (x, y) in a box: toward the edge it is near, or not at all.
ensureTsunagiPlayStyle関数Put the style in the page once: in the document's head, or in the shadow root the host is in.
keptView関数A view kept inside the board: never a gap between the board's edge and the box's.
mountTsunagi関数Draw a level into host and play it.
TSUNAGI_EDGE定数How near an edge of the box a line's end must be dragged to move the view, and how far each frame moves it, in pixels.
TSUNAGI_EDGE_STEP定数The native pixel increment for nudging the view near an edge.
TSUNAGI_FITTED定数The whole board, fitted.
TSUNAGI_MOST_ZOOM定数How far a board may be zoomed in, as a multiple of the whole board fitted to its box.
TSUNAGI_PLAY_STYLE定数THE STYLE a playable Tsunagi board wears (mountTsunagi, <tsunagi-board>): the drawing's own (TSUNAGI_STYLE) and the board's box, its buttons, its lines of words and its zoom pad.
TSUNAGI_ZOOM_FROM定数The smallest board a player is given the pad for.
TsunagiEventDetail型What a mounted board tells of itself in every event.
TsunagiLook型What a board looks like: every option drawTsunagi takes that does not depend on the lines.
TsunagiMount型The mounted native board handle and its game, display, action and cleanup methods.
TsunagiMountOptions型The puzzle, native display choices, controls and event callbacks for mounting a board.
TsunagiView型A BIG BOARD LOOKED AT THROUGH A BOX: from 10×10 up, a phone's cells are smaller than a thumb, so the board is drawn up to three times the box's width and looked at through it, zoomed and moved by a pad of buttons, the wheel and (while a line is dragged) the box's edge, never by scrolling the page.
zoomedAbout関数A view zoomed by factor about the point (px, py) of the box, which stays over the same spot of the board.

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

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