@wonderyard/vivarium 1.5.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/automaton/types.d.ts +1 -0
- package/dist/blueprint/ref-blueprint.js +2 -2
- package/dist/blueprint/rule-blueprint.js +2 -2
- package/dist/blueprint/utils.js +1 -1
- package/dist/blueprint/vivarium-blueprint.d.ts +3 -1
- package/dist/blueprint/vivarium-blueprint.js +7 -6
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +7 -6
- package/dist/common/utils.js +2 -2
- package/dist/{constants-BMg7uvpO.js → constants-BT-9-x_4.js} +181 -180
- package/dist/main.js +1 -1
- package/dist/{rule-blueprint-CIEvYOmb.js → rule-blueprint-C9qa6iP-.js} +1 -1
- package/dist/vivarium/vivarium.d.ts +4 -1
- package/dist/vivarium/vivarium.js +4 -4
- package/dist/webgpu/compiler.js +1 -1
- package/dist/webgpu/setup.d.ts +3 -0
- package/dist/webgpu/setup.js +3175 -3137
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ const life = vi.create();
|
|
|
73
73
|
const canvas = document.createElement(canvas);
|
|
74
74
|
document.body.appendChild(canvas);
|
|
75
75
|
|
|
76
|
-
// Set the canvas size. This will be the automaton size as well.
|
|
76
|
+
// Set the canvas size (must be a power of 2). This will be the automaton size as well.
|
|
77
77
|
const size = 256;
|
|
78
78
|
canvas.width = size;
|
|
79
79
|
canvas.height = size;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseBlueprint as n } from "./base-blueprint.js";
|
|
2
|
-
import { R as p } from "../rule-blueprint-
|
|
2
|
+
import { R as p } from "../rule-blueprint-C9qa6iP-.js";
|
|
3
3
|
import { toRefIdOrPoint as d } from "./utils.js";
|
|
4
|
-
import { A as u } from "../constants-
|
|
4
|
+
import { A as u } from "../constants-BT-9-x_4.js";
|
|
5
5
|
class o extends n {
|
|
6
6
|
constructor(e, t) {
|
|
7
7
|
super(), this.automaton = e, this.id = t.id, this.name = t.name, this.type = t.type;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as o, a as l } from "../rule-blueprint-
|
|
1
|
+
import { R as o, a as l } from "../rule-blueprint-C9qa6iP-.js";
|
|
2
2
|
import "./base-blueprint.js";
|
|
3
3
|
import "./utils.js";
|
|
4
|
-
import "../constants-
|
|
4
|
+
import "../constants-BT-9-x_4.js";
|
|
5
5
|
export {
|
|
6
6
|
o as RuleBlueprint,
|
|
7
7
|
l as RuleBlueprintWithAccept
|
package/dist/blueprint/utils.js
CHANGED
|
@@ -27,7 +27,9 @@ export declare class VivariumBlueprint<N extends Neighborhood = "square"> extend
|
|
|
27
27
|
* Includes {@link Helpers.not | not}, {@link Helpers.between | between}, {@link Helpers.even | even}, and {@link Helpers.odd | odd}.
|
|
28
28
|
*/
|
|
29
29
|
helpers: Helpers;
|
|
30
|
-
constructor(neighborhoodName?: N | undefined
|
|
30
|
+
constructor(neighborhoodName?: N | undefined, options?: {
|
|
31
|
+
wrapping?: boolean;
|
|
32
|
+
});
|
|
31
33
|
/**
|
|
32
34
|
* Defines a new element in the vivarium.
|
|
33
35
|
*
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { n as o } from "../rule-blueprint-
|
|
1
|
+
import { n as o } from "../rule-blueprint-C9qa6iP-.js";
|
|
2
2
|
import { BaseBlueprint as a } from "./base-blueprint.js";
|
|
3
3
|
import { Helpers as h } from "./helpers.js";
|
|
4
4
|
import { ElementBlueprint as m, KindBlueprint as u } from "./ref-blueprint.js";
|
|
5
|
-
import { C as
|
|
6
|
-
class
|
|
7
|
-
constructor(t) {
|
|
8
|
-
super(), this.neighborhoodName = t, this.helpers = new h(this.neighborhoodName), this.neighbor = this.neighborhoodName === "cross" ?
|
|
5
|
+
import { C as p, S as d } from "../constants-BT-9-x_4.js";
|
|
6
|
+
class C extends a {
|
|
7
|
+
constructor(t, e) {
|
|
8
|
+
super(), this.neighborhoodName = t, this.helpers = new h(this.neighborhoodName), this.neighbor = this.neighborhoodName === "cross" ? p : d, this.automaton = {
|
|
9
9
|
neighborhood: t ?? "square",
|
|
10
|
+
wrapping: e?.wrapping ?? !1,
|
|
10
11
|
elements: [],
|
|
11
12
|
kinds: [],
|
|
12
13
|
rules: []
|
|
@@ -75,5 +76,5 @@ class b extends a {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
C as VivariumBlueprint
|
|
79
80
|
};
|
package/dist/common/constants.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { A as o, C as e, b as
|
|
1
|
+
import { A as o, C as e, b as c, G as p, a as n, c4 as t, O as G, S as r, T as u, c3 as i, c as I, n as O } from "../constants-BT-9-x_4.js";
|
|
2
2
|
export {
|
|
3
3
|
o as Accept,
|
|
4
4
|
e as Cross,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
c as GpuCondition,
|
|
6
|
+
p as GpuElement,
|
|
7
7
|
n as GpuRule,
|
|
8
|
-
t as
|
|
8
|
+
t as MIN_GRID_SIZE,
|
|
9
|
+
G as Opcode,
|
|
9
10
|
r as Square,
|
|
10
11
|
u as To,
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
i as WORKGROUP_SIZE,
|
|
13
|
+
I as acceptMap,
|
|
13
14
|
O as neighborhoodPoints
|
|
14
15
|
};
|
package/dist/common/utils.js
CHANGED
|
@@ -295,11 +295,11 @@ const f = (e) => {
|
|
|
295
295
|
const t = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
296
296
|
e = e.replace(
|
|
297
297
|
t,
|
|
298
|
-
(l, a,
|
|
298
|
+
(l, a, n, c) => a + a + n + n + c + c
|
|
299
299
|
);
|
|
300
300
|
const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
301
301
|
if (!r)
|
|
302
|
-
throw new Error(
|
|
302
|
+
throw new Error(`Bad color: ${e}`);
|
|
303
303
|
const s = parseInt(r[1], 16), u = parseInt(r[2], 16);
|
|
304
304
|
return 4278190080 | parseInt(r[3], 16) << 16 | u << 8 | s;
|
|
305
305
|
};
|