Reference · Pipes, rules and solving
tapsBetweenfunction
The taps it takes to face a piece the right way when a tap turns it one way
only (both false) or either way (both true, the shorter of the two).
Import it
import { tapsBetween } from "@johnmorrisdotca/suido";
Definition
function tapsBetween(from: number, to: number, both?: boolean): number | null
Parameters
| Name | Type | Description |
|---|---|---|
from | number | The original pipe mask or mask array specified by the signature. |
to | number | The desired pipe mask or mask array specified by the signature. |
both (optional) | boolean | Whether turns may go clockwise or anticlockwise. |
Returns
number | null
The fewest permitted taps, or null when the two masks have different shapes.
Examples
import { tapsBetween } from "@johnmorrisdotca/suido";
console.log(tapsBetween(3,6,true));1What it prints (run when this page was built)