@thi.ng/cellular 0.2.109 → 0.2.111

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.
Files changed (4) hide show
  1. package/1d.js +6 -12
  2. package/CHANGELOG.md +1 -1
  3. package/README.md +2 -2
  4. package/package.json +13 -13
package/1d.js CHANGED
@@ -95,8 +95,7 @@ class MultiCA1D {
95
95
  const [dest, num] = this._getTarget(target);
96
96
  const fn = target === "prob" ? () => rnd.float() : () => rnd.int() % num;
97
97
  for (let x = 0, width = this.width; x < width; x++) {
98
- if (rnd.probability(prob))
99
- dest[x] = fn();
98
+ if (rnd.probability(prob)) dest[x] = fn();
100
99
  }
101
100
  return this;
102
101
  }
@@ -142,15 +141,11 @@ class MultiCA1D {
142
141
  const k = kernel[i];
143
142
  let xx = x + k[0];
144
143
  if (wrap) {
145
- if (xx < 0)
146
- xx += width;
147
- else if (xx >= width)
148
- xx -= width;
149
- } else if (xx < 0 || xx >= width)
150
- continue;
144
+ if (xx < 0) xx += width;
145
+ else if (xx >= width) xx -= width;
146
+ } else if (xx < 0 || xx >= width) continue;
151
147
  const y = k[1];
152
- if (y >= 0 && gens[1 + y][xx] !== 0)
153
- sum += weights[i];
148
+ if (y >= 0 && gens[1 + y][xx] !== 0) sum += weights[i];
154
149
  }
155
150
  return rule & $1 << sum ? fn(val) : 0;
156
151
  }
@@ -234,8 +229,7 @@ const randomRule1D = (kernelSize, rnd = SYSTEM) => {
234
229
  for (let i = $0; i < n; i += $32) {
235
230
  id <<= $32;
236
231
  let mask = n - i;
237
- if (mask > $32)
238
- mask = $32;
232
+ if (mask > $32) mask = $32;
239
233
  id |= BigInt(rnd.int()) & ($1 << mask) - $1;
240
234
  }
241
235
  return id;
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-23T07:02:17Z
3
+ - **Last updated**: 2024-06-21T19:34:38Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 192 standalone projects, maintained as part
10
+ > This is one of 193 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
@@ -171,7 +171,7 @@ For Node.js REPL:
171
171
  const cell = await import("@thi.ng/cellular");
172
172
  ```
173
173
 
174
- Package sizes (brotli'd, pre-treeshake): ESM: 1.46 KB
174
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.45 KB
175
175
 
176
176
  ## Dependencies
177
177
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/cellular",
3
- "version": "0.2.109",
3
+ "version": "0.2.111",
4
4
  "description": "Highly customizable 1D cellular automata, shared env, multiple rules, arbitrary sized/shaped neighborhoods, short term memory, cell states etc.",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
12
12
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/cellular#readme",
13
+ "homepage": "https://thi.ng/cellular",
14
14
  "funding": [
15
15
  {
16
16
  "type": "github",
@@ -36,18 +36,18 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.11.1",
40
- "@thi.ng/arrays": "^2.9.5",
41
- "@thi.ng/checks": "^3.6.3",
42
- "@thi.ng/errors": "^2.5.6",
43
- "@thi.ng/random": "^3.7.5",
44
- "@thi.ng/transducers": "^9.0.4"
39
+ "@thi.ng/api": "^8.11.3",
40
+ "@thi.ng/arrays": "^2.9.7",
41
+ "@thi.ng/checks": "^3.6.5",
42
+ "@thi.ng/errors": "^2.5.8",
43
+ "@thi.ng/random": "^3.8.1",
44
+ "@thi.ng/transducers": "^9.0.6"
45
45
  },
46
46
  "devDependencies": {
47
- "@microsoft/api-extractor": "^7.43.0",
48
- "esbuild": "^0.20.2",
49
- "typedoc": "^0.25.12",
50
- "typescript": "^5.4.3"
47
+ "@microsoft/api-extractor": "^7.47.0",
48
+ "esbuild": "^0.21.5",
49
+ "typedoc": "^0.25.13",
50
+ "typescript": "^5.5.2"
51
51
  },
52
52
  "keywords": [
53
53
  "1d",
@@ -94,5 +94,5 @@
94
94
  ],
95
95
  "year": 2022
96
96
  },
97
- "gitHead": "aed3421c21044c005fbcb7cc37965ccf85a870d2\n"
97
+ "gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
98
98
  }