本文へ移動

Tobiishi飛び石

9種類の盤で石を飛び越え、シード付きの解ける問題を作り、ページにペグ・ソリティアを追加できます。

「飛び石」は、間を空けて並べた石のことです。 名前について(英語)

目次

リファレンス · 盤・規則・チャレンジ

GoalChallenge型

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

Generated puzzle augmented with its pack, goal, and requested length category.

インポート

import type { GoalChallenge } from "@johnmorrisdotca/tobiishi";

定義

type GoalChallenge = Challenge & Readonly<{
    pack: Shape;
    packTitle: string;
    difficulty: ChallengeDifficulty;
    goal: GoalHole;
}>;

メンバー

名前型説明
gameReadonly<{ board: Board; start: readonly boolean[]; pegs: readonly boolean[]; target: number | null; history: readonly Jump[]; helped: boolean; }>
answerreadonly Readonly<{ from: number; over: number; to: number; }>[]
seedstring
packShape
packTitlestring
difficultyChallengeDifficulty
goalReadonly<{ id: string; names: Readonly<Record<"en" | "ja", string>>; x: number; y: number; }>

例

import type { GoalChallenge } from "@johnmorrisdotca/tobiishi";
import { generateTobiishiChallenge } from "@johnmorrisdotca/tobiishi";

const value: GoalChallenge = generateTobiishiChallenge("english","centre","easy");
console.log(value);
{
  game: {
    board: {
      name: 'english',
      lattice: 'square',
      cells: [Array],
      jumps: [Array]
    },
    start: [
      false, false, false, false, true,
      false, false, false, false, true,
      false, false, false, false, true,
      false, false, true,  false, false,
      false, false, false, false, false,
      false, false, false, false, false,
      false, false, false
    ],
    pegs: [
      false, false, false, false, true,
      false, false, false, false, true,
      false, false, false, false, true,
      false, false, true,  false, false,
      false, false, false, false, false,
      false, false, false, false, false,
      false, false, false
    ],
    target: 16,
    history: [],
    helped: false
  },
  answer: [
    { from: 4, over: 9, to: 16 },
    { from: 17, over: 16, to: 15 },
    { from: 14, over: 15, to: 16 }
  ],
  seed: 'tobiishi-pack:english:centre:easy',
  pack: 'english',
  packTitle: 'Crossroads',
  difficulty: 'easy',
  goal: { id: 'centre', names: { en: 'Centre', ja: '中央' }, x: 3, y: 3 }
}

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

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

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