本文へ移動

Suido水道

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

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

目次

リファレンス · 管・ルール・解法

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).

masks is by where a piece is now; quarters is by the cell the piece was given in. They are the same cell for every piece but those in a block that turns as one (blocks.ts), which move round their block: the four pieces of a block all have the quarters the block has been turned.

インポート

import type { Game } from "@johnmorrisdotca/suido";

定義

type Game = {
    start: Layout;
    masks: number[];
    quarters: number[];
    turns: number;
};

メンバー

名前型説明
startLayout

The board as it was first given.

masksnumber[]

The sides each piece opens on now.

quartersnumber[]

Quarter turns clockwise each piece has had, counting a turn the other way as minus one.

turnsnumber

Taps that turned a piece.

例

import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { newGame } from "@johnmorrisdotca/suido";
import type { Game } from "@johnmorrisdotca/suido";

const row = SUIDO_5X5[0];
const code = row[0];
const game = newGame(code)!;
const value: Game = game;
console.log(value);
{
  start: {
    width: 5,
    height: 5,
    kind: 'network',
    wrap: false,
    cells: [
      3, 5, 10,  5, 2,  5,  8,  5,
      9, 8, 11,  7, 5, 15,  7, 10,
      6, 2,  2, 10, 3,  5, 10,  8,
      2
    ],
    sources: [ 0 ],
    drains: [
       4,  6,  9, 17,
      18, 23, 24
    ]
  },
  masks: [
    3, 5, 10,  5, 2,  5,  8,  5,
    9, 8, 11,  7, 5, 15,  7, 10,
    6, 2,  2, 10, 3,  5, 10,  8,
    2
  ],
  quarters: [
    0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0,
    0
  ],
  turns: 0
}

出力(このページを作ったときに実行した結果)

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

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