Skip to the content

Karakuriからくり

Play eight native puzzles, run bounded searches, step deterministic physics and mount a canvas player controlled by pointer or keyboard.

Karakuri is the Japanese word からくり for a mechanism or ingenious device. About the name

Contents

Reference · Deterministic 2D physics

rigNumbersfunction

Every number of the rig's nodes, for hashing it.

Import it

import { rigNumbers } from "@johnmorrisdotca/karakuri/physics";

Definition

function rigNumbers(rig: Rig): number[]

Parameters

NameTypeDescription
rigRig

The mutable native rope nodes, constraints and static geometry.

Returns

number[]

Every number of the rig's nodes, for hashing it.

Examples

import { addRope, createRig, rigNumbers } from "@johnmorrisdotca/karakuri/physics";

const rig=createRig({gravity:0,iterations:1});
addRope(rig,0,0,10,0,2);
console.log(rigNumbers(rig));
[
   0, 0, 0,  0, 5,
   0, 5, 0, 10, 0,
  10, 0
]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/karakuri 0.2.1.