本文へ移動

Suido水道

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

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

目次

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

Made型

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

A new board: its code, the code of its one answer, and what it was made from.

インポート

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

定義

type Made = {
    code: string;
    answer: string;
    layout: Layout;
    solution: number[];
    seed: number;
    discarded: number;
};

メンバー

名前型説明
codestring

The board as the player first sees it, every piece turned at random.

answerstring

The board solved: the same pieces facing as the answer has them.

layoutLayout
solutionnumber[]

The sides the answer's pieces open on.

seednumber
discardednumber

How many boards were laid and thrown away before this one had exactly one answer.

例

import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { decodeLayout } from "@johnmorrisdotca/suido";
import { levelAnswer, levelSolution } from "@johnmorrisdotca/suido/levels";
import type { Made } from "@johnmorrisdotca/suido";

const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const answer = levelAnswer(row)!;
const solution = levelSolution(row)!;
const value: Made = {code,answer,layout,solution,seed:42,discarded:0};
console.log(value);
{
  code: '5x5:j5a5C5I59Ib75f7a6CCa35aIC',
  answer: '5x5:maaaI5CacE7eafd53IB53aaIB',
  layout: {
    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
    ]
  },
  solution: [
     6, 10, 10, 10,  8,  5,  2, 10,
    12,  4,  7, 14, 10, 15, 13,  5,
     3,  8,  1,  5,  3, 10, 10,  8,
     1
  ],
  seed: 42,
  discarded: 0
}

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

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

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