Reference · Pipes, rules and solving
Madetype
A new board: its code, the code of its one answer, and what it was made from.
Import it
import type { Made } from "@johnmorrisdotca/suido";
Definition
type Made = {
code: string;
answer: string;
layout: Layout;
solution: number[];
seed: number;
discarded: number;
};
Members
| Name | Type | Description |
|---|---|---|
code | string | The board as the player first sees it, every piece turned at random. |
answer | string | The board solved: the same pieces facing as the answer has them. |
layout | Layout | |
solution | number[] | The sides the answer's pieces open on. |
seed | number | |
discarded | number | How many boards were laid and thrown away before this one had exactly one answer. |
Examples
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
}What it prints (run when this page was built)