@logic-pad/core 0.6.1 → 0.9.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.
Files changed (41) hide show
  1. package/assets/logic-core.global.d.ts +134 -11
  2. package/dist/data/config.d.ts +6 -2
  3. package/dist/data/config.js +1 -0
  4. package/dist/data/events/onGetTile.d.ts +7 -0
  5. package/dist/data/events/onGetTile.js +4 -0
  6. package/dist/data/grid.d.ts +9 -3
  7. package/dist/data/grid.js +50 -10
  8. package/dist/data/primitives.d.ts +9 -1
  9. package/dist/data/primitives.js +14 -0
  10. package/dist/data/rules/banPatternRule.js +11 -6
  11. package/dist/data/rules/cellCountPerZoneRule.js +9 -7
  12. package/dist/data/rules/regionShapeRule.js +7 -3
  13. package/dist/data/rules/rules.gen.d.ts +1 -0
  14. package/dist/data/rules/rules.gen.js +1 -0
  15. package/dist/data/rules/wrapAroundRule.d.ts +34 -0
  16. package/dist/data/rules/wrapAroundRule.js +271 -0
  17. package/dist/data/serializer/serializer_v0.js +3 -0
  18. package/dist/data/solver/backtrack/backtrackSolver.d.ts +1 -0
  19. package/dist/data/solver/backtrack/backtrackSolver.js +8 -0
  20. package/dist/data/solver/backtrack/backtrackWorker.js +11 -0
  21. package/dist/data/solver/backtrack/symbols/focus.d.ts +9 -0
  22. package/dist/data/solver/backtrack/symbols/focus.js +59 -0
  23. package/dist/data/solver/eventIteratingSolver.d.ts +3 -2
  24. package/dist/data/solver/eventIteratingSolver.js +13 -2
  25. package/dist/data/solver/solver.d.ts +11 -6
  26. package/dist/data/solver/universal/universalSolver.d.ts +1 -0
  27. package/dist/data/solver/universal/universalSolver.js +6 -0
  28. package/dist/data/solver/universal/universalWorker.js +5 -0
  29. package/dist/data/solver/z3/z3Solver.d.ts +2 -0
  30. package/dist/data/solver/z3/z3Solver.js +12 -0
  31. package/dist/data/symbols/directionLinkerSymbol.js +15 -9
  32. package/dist/data/symbols/focusSymbol.d.ts +30 -0
  33. package/dist/data/symbols/focusSymbol.js +110 -0
  34. package/dist/data/symbols/minesweeperSymbol.d.ts +1 -1
  35. package/dist/data/symbols/minesweeperSymbol.js +9 -2
  36. package/dist/data/symbols/symbols.gen.d.ts +1 -0
  37. package/dist/data/symbols/symbols.gen.js +1 -0
  38. package/dist/data/symbols/viewpointSymbol.js +10 -11
  39. package/dist/index.d.ts +6 -2
  40. package/dist/index.js +6 -2
  41. package/package.json +1 -1
@@ -14,12 +14,24 @@ export default class Z3Solver extends Solver {
14
14
  writable: true,
15
15
  value: 'z3'
16
16
  });
17
+ Object.defineProperty(this, "author", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: 'Lysine'
22
+ });
17
23
  Object.defineProperty(this, "description", {
18
24
  enumerable: true,
19
25
  configurable: true,
20
26
  writable: true,
21
27
  value: 'Good for confirming that a solution is unique, especially for larger puzzles. It is otherwise slower than most solvers in small to medium-sized puzzles.'
22
28
  });
29
+ Object.defineProperty(this, "supportsCancellation", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: false
34
+ });
23
35
  }
24
36
  async isEnvironmentSupported() {
25
37
  try {
@@ -120,17 +120,23 @@ class DirectionLinkerSymbol extends Symbol {
120
120
  color1: baseColor1,
121
121
  color2: baseColor2,
122
122
  };
123
- if (checkedCouples.some(({ pos1, pos2 }) => pos1.x === newTurtle.pos1.x &&
124
- pos1.y === newTurtle.pos1.y &&
125
- pos2.x === newTurtle.pos2.x &&
126
- pos2.y === newTurtle.pos2.y) ||
127
- (pos1.x === newTurtle.pos2.x &&
128
- pos1.y === newTurtle.pos2.y &&
129
- pos2.x === newTurtle.pos1.x &&
130
- pos2.y === newTurtle.pos1.y)) {
123
+ const newArrTurtle = {
124
+ pos1: grid.toArrayCoordinates(newTurtle.pos1.x, newTurtle.pos1.y),
125
+ pos2: grid.toArrayCoordinates(newTurtle.pos2.x, newTurtle.pos2.y),
126
+ color1: baseColor1,
127
+ color2: baseColor2,
128
+ };
129
+ if (checkedCouples.some(({ pos1, pos2 }) => pos1.x === newArrTurtle.pos1.x &&
130
+ pos1.y === newArrTurtle.pos1.y &&
131
+ pos2.x === newArrTurtle.pos2.x &&
132
+ pos2.y === newArrTurtle.pos2.y) ||
133
+ (pos1.x === newArrTurtle.pos2.x &&
134
+ pos1.y === newArrTurtle.pos2.y &&
135
+ pos2.x === newArrTurtle.pos1.x &&
136
+ pos2.y === newArrTurtle.pos1.y)) {
131
137
  continue;
132
138
  }
133
- checkedCouples.push(newTurtle);
139
+ checkedCouples.push(newArrTurtle);
134
140
  queue.push(newTurtle);
135
141
  }
136
142
  }
@@ -0,0 +1,30 @@
1
+ import { AnyConfig } from '../config.js';
2
+ import GridData from '../grid.js';
3
+ import NumberSymbol from './numberSymbol.js';
4
+ export default class FocusSymbol extends NumberSymbol {
5
+ private static readonly CONFIGS;
6
+ private static readonly EXAMPLE_GRID;
7
+ /**
8
+ * **Focus Numbers count directly adjacent cells of the same color**
9
+ * @param x - The x-coordinate of the symbol.
10
+ * @param y - The y-coordinate of the symbol.
11
+ * @param number - The focus number.
12
+ */
13
+ constructor(x: number, y: number, number: number);
14
+ get id(): string;
15
+ get placementStep(): number;
16
+ get explanation(): string;
17
+ get configs(): readonly AnyConfig[] | null;
18
+ createExampleGrid(): GridData;
19
+ countTiles(grid: GridData): {
20
+ completed: number;
21
+ possible: number;
22
+ };
23
+ copyWith({ x, y, number, }: {
24
+ x?: number;
25
+ y?: number;
26
+ number?: number;
27
+ }): this;
28
+ withNumber(number: number): this;
29
+ }
30
+ export declare const instance: FocusSymbol;
@@ -0,0 +1,110 @@
1
+ import { ConfigType } from '../config.js';
2
+ import GridData from '../grid.js';
3
+ import { Color } from '../primitives.js';
4
+ import NumberSymbol from './numberSymbol.js';
5
+ const OFFSETS = [
6
+ [0, -1],
7
+ [1, 0],
8
+ [0, 1],
9
+ [-1, 0],
10
+ ];
11
+ class FocusSymbol extends NumberSymbol {
12
+ /**
13
+ * **Focus Numbers count directly adjacent cells of the same color**
14
+ * @param x - The x-coordinate of the symbol.
15
+ * @param y - The y-coordinate of the symbol.
16
+ * @param number - The focus number.
17
+ */
18
+ constructor(x, y, number) {
19
+ super(x, y, number);
20
+ }
21
+ get id() {
22
+ return `focus`;
23
+ }
24
+ get placementStep() {
25
+ return 1;
26
+ }
27
+ get explanation() {
28
+ return '*Focus Numbers* count directly adjacent cells of the same color';
29
+ }
30
+ get configs() {
31
+ return FocusSymbol.CONFIGS;
32
+ }
33
+ createExampleGrid() {
34
+ return FocusSymbol.EXAMPLE_GRID;
35
+ }
36
+ countTiles(grid) {
37
+ if (Math.floor(this.x) !== this.x || Math.floor(this.y) !== this.y)
38
+ return { completed: 0, possible: Number.MAX_SAFE_INTEGER };
39
+ const color = grid.getTile(this.x, this.y).color;
40
+ if (color === Color.Gray)
41
+ return { completed: 0, possible: Number.MAX_SAFE_INTEGER };
42
+ let gray = 0;
43
+ let same = 0;
44
+ const visited = [];
45
+ for (const [dx, dy] of OFFSETS) {
46
+ const x = this.x + dx;
47
+ const y = this.y + dy;
48
+ if (grid.wrapAround.value) {
49
+ const pos = grid.toArrayCoordinates(x, y);
50
+ if (visited.some(v => v.x === pos.x && v.y === pos.y))
51
+ continue;
52
+ visited.push(pos);
53
+ }
54
+ const tile = grid.getTile(x, y);
55
+ if (!tile.exists)
56
+ continue;
57
+ if (tile.color === Color.Gray)
58
+ gray++;
59
+ else if (tile.color === color)
60
+ same++;
61
+ }
62
+ return { completed: same, possible: same + gray };
63
+ }
64
+ copyWith({ x, y, number, }) {
65
+ return new FocusSymbol(x ?? this.x, y ?? this.y, number ?? this.number);
66
+ }
67
+ withNumber(number) {
68
+ return this.copyWith({ number });
69
+ }
70
+ }
71
+ Object.defineProperty(FocusSymbol, "CONFIGS", {
72
+ enumerable: true,
73
+ configurable: true,
74
+ writable: true,
75
+ value: Object.freeze([
76
+ {
77
+ type: ConfigType.Number,
78
+ default: 0,
79
+ field: 'x',
80
+ description: 'X',
81
+ configurable: false,
82
+ },
83
+ {
84
+ type: ConfigType.Number,
85
+ default: 0,
86
+ field: 'y',
87
+ description: 'Y',
88
+ configurable: false,
89
+ },
90
+ {
91
+ type: ConfigType.Number,
92
+ default: 1,
93
+ field: 'number',
94
+ description: 'Number',
95
+ configurable: true,
96
+ },
97
+ ])
98
+ });
99
+ Object.defineProperty(FocusSymbol, "EXAMPLE_GRID", {
100
+ enumerable: true,
101
+ configurable: true,
102
+ writable: true,
103
+ value: Object.freeze(GridData.create(['wwwww', 'bbbbw', 'wwbbw', 'wwwww']).withSymbols([
104
+ new FocusSymbol(0, 0, 1),
105
+ new FocusSymbol(4, 1, 2),
106
+ new FocusSymbol(1, 3, 3),
107
+ ]))
108
+ });
109
+ export default FocusSymbol;
110
+ export const instance = new FocusSymbol(0, 0, 1);
@@ -5,7 +5,7 @@ export default class MinesweeperSymbol extends NumberSymbol {
5
5
  private static readonly CONFIGS;
6
6
  private static readonly EXAMPLE_GRID;
7
7
  /**
8
- * **Minesweeper numbers count opposite cells in 8 adjacent spaces**
8
+ * **Minesweeper Numbers count opposite cells in 8 adjacent spaces**
9
9
  *
10
10
  * @param x - The x-coordinate of the symbol.
11
11
  * @param y - The y-coordinate of the symbol.
@@ -4,7 +4,7 @@ import { Color } from '../primitives.js';
4
4
  import NumberSymbol from './numberSymbol.js';
5
5
  class MinesweeperSymbol extends NumberSymbol {
6
6
  /**
7
- * **Minesweeper numbers count opposite cells in 8 adjacent spaces**
7
+ * **Minesweeper Numbers count opposite cells in 8 adjacent spaces**
8
8
  *
9
9
  * @param x - The x-coordinate of the symbol.
10
10
  * @param y - The y-coordinate of the symbol.
@@ -20,7 +20,7 @@ class MinesweeperSymbol extends NumberSymbol {
20
20
  return 1;
21
21
  }
22
22
  get explanation() {
23
- return `*Minesweeper numbers* count opposite cells in 8 adjacent spaces`;
23
+ return `*Minesweeper Numbers* count opposite cells in 8 adjacent spaces`;
24
24
  }
25
25
  get configs() {
26
26
  return MinesweeperSymbol.CONFIGS;
@@ -36,10 +36,17 @@ class MinesweeperSymbol extends NumberSymbol {
36
36
  return { completed: 0, possible: Number.MAX_SAFE_INTEGER };
37
37
  let gray = 0;
38
38
  let opposite = 0;
39
+ const visited = [];
39
40
  for (let y = this.y - 1; y <= this.y + 1; y++) {
40
41
  for (let x = this.x - 1; x <= this.x + 1; x++) {
41
42
  if (x === this.x && y === this.y)
42
43
  continue;
44
+ if (grid.wrapAround.value) {
45
+ const pos = grid.toArrayCoordinates(x, y);
46
+ if (visited.some(v => v.x === pos.x && v.y === pos.y))
47
+ continue;
48
+ visited.push(pos);
49
+ }
43
50
  const tile = grid.getTile(x, y);
44
51
  if (!tile.exists)
45
52
  continue;
@@ -2,6 +2,7 @@ export { instance as AreaNumberSymbol } from './areaNumberSymbol.js';
2
2
  export { instance as CustomIconSymbol } from './customIconSymbol.js';
3
3
  export { instance as CustomTextSymbol } from './customTextSymbol.js';
4
4
  export { instance as DartSymbol } from './dartSymbol.js';
5
+ export { instance as FocusSymbol } from './focusSymbol.js';
5
6
  export { instance as GalaxySymbol } from './galaxySymbol.js';
6
7
  export { instance as HiddenSymbol } from './hiddenSymbol.js';
7
8
  export { instance as LetterSymbol } from './letterSymbol.js';
@@ -6,6 +6,7 @@ export { instance as AreaNumberSymbol } from './areaNumberSymbol.js';
6
6
  export { instance as CustomIconSymbol } from './customIconSymbol.js';
7
7
  export { instance as CustomTextSymbol } from './customTextSymbol.js';
8
8
  export { instance as DartSymbol } from './dartSymbol.js';
9
+ export { instance as FocusSymbol } from './focusSymbol.js';
9
10
  export { instance as GalaxySymbol } from './galaxySymbol.js';
10
11
  export { instance as HiddenSymbol } from './hiddenSymbol.js';
11
12
  export { instance as LetterSymbol } from './letterSymbol.js';
@@ -1,6 +1,6 @@
1
1
  import { ConfigType } from '../config.js';
2
2
  import GridData from '../grid.js';
3
- import { move } from '../dataHelper.js';
3
+ import { array, move } from '../dataHelper.js';
4
4
  import { Color, DIRECTIONS } from '../primitives.js';
5
5
  import NumberSymbol from './numberSymbol.js';
6
6
  class ViewpointSymbol extends NumberSymbol {
@@ -31,18 +31,17 @@ class ViewpointSymbol extends NumberSymbol {
31
31
  countForColor(grid, color, pos) {
32
32
  let minSize = 1;
33
33
  let maxSize = 1;
34
+ const visitedColored = array(grid.width, grid.height, (x, y) => x === pos.x && y === pos.y);
34
35
  for (const direction of DIRECTIONS) {
35
- let continuous = true;
36
- grid.iterateDirection(move(pos, direction), direction, tile => tile.color === color || tile.color === Color.Gray, tile => {
36
+ grid.iterateDirection(move(pos, direction), direction, tile => tile.color === color, () => {
37
+ minSize++;
38
+ }, visitedColored);
39
+ }
40
+ const visitedAll = array(grid.width, grid.height, (x, y) => x === pos.x && y === pos.y);
41
+ for (const direction of DIRECTIONS) {
42
+ grid.iterateDirection(move(pos, direction), direction, tile => tile.color === color || tile.color === Color.Gray, () => {
37
43
  maxSize++;
38
- if (tile.color === Color.Gray) {
39
- continuous = false;
40
- }
41
- else {
42
- if (continuous)
43
- minSize++;
44
- }
45
- });
44
+ }, visitedAll);
46
45
  }
47
46
  return { completed: minSize, possible: maxSize };
48
47
  }
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import Configurable from './data/configurable.js';
3
3
  import { CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape } from './data/dataHelper.js';
4
4
  import { isEventHandler } from './data/events/eventHelper.js';
5
5
  import { handlesFinalValidation } from './data/events/onFinalValidation.js';
6
+ import { handlesGetTile } from './data/events/onGetTile.js';
6
7
  import { handlesGridChange } from './data/events/onGridChange.js';
7
8
  import { handlesGridResize } from './data/events/onGridResize.js';
8
9
  import { handlesSetGrid, invokeSetGrid } from './data/events/onSetGrid.js';
@@ -12,7 +13,7 @@ import GridData, { NEIGHBOR_OFFSETS } from './data/grid.js';
12
13
  import GridConnections from './data/gridConnections.js';
13
14
  import GridZones from './data/gridZones.js';
14
15
  import Instruction from './data/instruction.js';
15
- import { COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, State, directionToggle, orientationToggle } from './data/primitives.js';
16
+ import { COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle } from './data/primitives.js';
16
17
  import { MetadataSchema, PuzzleSchema } from './data/puzzle.js';
17
18
  import BanPatternRule from './data/rules/banPatternRule.js';
18
19
  import CellCountPerZoneRule from './data/rules/cellCountPerZoneRule.js';
@@ -35,6 +36,7 @@ import SameShapeRule from './data/rules/sameShapeRule.js';
35
36
  import SymbolsPerRegionRule from './data/rules/symbolsPerRegionRule.js';
36
37
  import UndercluedRule from './data/rules/undercluedRule.js';
37
38
  import UniqueShapeRule from './data/rules/uniqueShapeRule.js';
39
+ import WrapAroundRule from './data/rules/wrapAroundRule.js';
38
40
  import { Serializer } from './data/serializer/allSerializers.js';
39
41
  import { Compressor } from './data/serializer/compressor/allCompressors.js';
40
42
  import CompressorBase from './data/serializer/compressor/compressorBase.js';
@@ -58,6 +60,7 @@ import UniqueShapeBTModule from './data/solver/backtrack/rules/uniqueShape.js';
58
60
  import AreaNumberBTModule from './data/solver/backtrack/symbols/areaNumber.js';
59
61
  import DartBTModule from './data/solver/backtrack/symbols/dart.js';
60
62
  import DirectionLinkerBTModule from './data/solver/backtrack/symbols/directionLinker.js';
63
+ import FocusBTModule from './data/solver/backtrack/symbols/focus.js';
61
64
  import GalaxyBTModule from './data/solver/backtrack/symbols/galaxy.js';
62
65
  import LetterBTModule from './data/solver/backtrack/symbols/letter.js';
63
66
  import LotusBTModule from './data/solver/backtrack/symbols/lotus.js';
@@ -86,6 +89,7 @@ import CustomSymbol from './data/symbols/customSymbol.js';
86
89
  import CustomTextSymbol from './data/symbols/customTextSymbol.js';
87
90
  import DartSymbol from './data/symbols/dartSymbol.js';
88
91
  import DirectionLinkerSymbol from './data/symbols/directionLinkerSymbol.js';
92
+ import FocusSymbol from './data/symbols/focusSymbol.js';
89
93
  import GalaxySymbol from './data/symbols/galaxySymbol.js';
90
94
  import HiddenSymbol from './data/symbols/hiddenSymbol.js';
91
95
  import { allSymbols } from './data/symbols/index.js';
@@ -100,4 +104,4 @@ import ViewpointSymbol from './data/symbols/viewpointSymbol.js';
100
104
  import TileData from './data/tile.js';
101
105
  import TileConnections from './data/tileConnections.js';
102
106
  import validateGrid, { aggregateState, applyFinalOverrides } from './data/validate.js';
103
- export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, State, directionToggle, orientationToggle, MetadataSchema, PuzzleSchema, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, CustomRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, Serializer, Compressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerV0, getShapeVariants, normalizeShape, positionsToShape, shapeEquals, tilesToShape, allSolvers, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, EventIteratingSolver, Solver, UniversalSolver, AreaNumberModule, CellCountModule, ConnectAllModule, DartModule, allZ3Modules, LetterModule, MyopiaModule, RegionAreaModule, ViewpointModule, Z3Module, convertDirection, Z3Solver, Z3SolverContext, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, GalaxySymbol, HiddenSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MultiEntrySymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, };
107
+ export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle, MetadataSchema, PuzzleSchema, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, CustomRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerV0, getShapeVariants, normalizeShape, positionsToShape, shapeEquals, tilesToShape, allSolvers, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, EventIteratingSolver, Solver, UniversalSolver, AreaNumberModule, CellCountModule, ConnectAllModule, DartModule, allZ3Modules, LetterModule, MyopiaModule, RegionAreaModule, ViewpointModule, Z3Module, convertDirection, Z3Solver, Z3SolverContext, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, FocusSymbol, GalaxySymbol, HiddenSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MultiEntrySymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, };
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ import Configurable from './data/configurable.js';
6
6
  import { CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape } from './data/dataHelper.js';
7
7
  import { isEventHandler } from './data/events/eventHelper.js';
8
8
  import { handlesFinalValidation } from './data/events/onFinalValidation.js';
9
+ import { handlesGetTile } from './data/events/onGetTile.js';
9
10
  import { handlesGridChange } from './data/events/onGridChange.js';
10
11
  import { handlesGridResize } from './data/events/onGridResize.js';
11
12
  import { handlesSetGrid, invokeSetGrid } from './data/events/onSetGrid.js';
@@ -15,7 +16,7 @@ import GridData, { NEIGHBOR_OFFSETS } from './data/grid.js';
15
16
  import GridConnections from './data/gridConnections.js';
16
17
  import GridZones from './data/gridZones.js';
17
18
  import Instruction from './data/instruction.js';
18
- import { COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, State, directionToggle, orientationToggle } from './data/primitives.js';
19
+ import { COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle } from './data/primitives.js';
19
20
  import { MetadataSchema, PuzzleSchema } from './data/puzzle.js';
20
21
  import BanPatternRule from './data/rules/banPatternRule.js';
21
22
  import CellCountPerZoneRule from './data/rules/cellCountPerZoneRule.js';
@@ -38,6 +39,7 @@ import SameShapeRule from './data/rules/sameShapeRule.js';
38
39
  import SymbolsPerRegionRule from './data/rules/symbolsPerRegionRule.js';
39
40
  import UndercluedRule from './data/rules/undercluedRule.js';
40
41
  import UniqueShapeRule from './data/rules/uniqueShapeRule.js';
42
+ import WrapAroundRule from './data/rules/wrapAroundRule.js';
41
43
  import { Serializer } from './data/serializer/allSerializers.js';
42
44
  import { Compressor } from './data/serializer/compressor/allCompressors.js';
43
45
  import CompressorBase from './data/serializer/compressor/compressorBase.js';
@@ -61,6 +63,7 @@ import UniqueShapeBTModule from './data/solver/backtrack/rules/uniqueShape.js';
61
63
  import AreaNumberBTModule from './data/solver/backtrack/symbols/areaNumber.js';
62
64
  import DartBTModule from './data/solver/backtrack/symbols/dart.js';
63
65
  import DirectionLinkerBTModule from './data/solver/backtrack/symbols/directionLinker.js';
66
+ import FocusBTModule from './data/solver/backtrack/symbols/focus.js';
64
67
  import GalaxyBTModule from './data/solver/backtrack/symbols/galaxy.js';
65
68
  import LetterBTModule from './data/solver/backtrack/symbols/letter.js';
66
69
  import LotusBTModule from './data/solver/backtrack/symbols/lotus.js';
@@ -89,6 +92,7 @@ import CustomSymbol from './data/symbols/customSymbol.js';
89
92
  import CustomTextSymbol from './data/symbols/customTextSymbol.js';
90
93
  import DartSymbol from './data/symbols/dartSymbol.js';
91
94
  import DirectionLinkerSymbol from './data/symbols/directionLinkerSymbol.js';
95
+ import FocusSymbol from './data/symbols/focusSymbol.js';
92
96
  import GalaxySymbol from './data/symbols/galaxySymbol.js';
93
97
  import HiddenSymbol from './data/symbols/hiddenSymbol.js';
94
98
  import { allSymbols } from './data/symbols/index.js';
@@ -103,4 +107,4 @@ import ViewpointSymbol from './data/symbols/viewpointSymbol.js';
103
107
  import TileData from './data/tile.js';
104
108
  import TileConnections from './data/tileConnections.js';
105
109
  import validateGrid, { aggregateState, applyFinalOverrides } from './data/validate.js';
106
- export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, State, directionToggle, orientationToggle, MetadataSchema, PuzzleSchema, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, CustomRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, Serializer, Compressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerV0, getShapeVariants, normalizeShape, positionsToShape, shapeEquals, tilesToShape, allSolvers, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, EventIteratingSolver, Solver, UniversalSolver, AreaNumberModule, CellCountModule, ConnectAllModule, DartModule, allZ3Modules, LetterModule, MyopiaModule, RegionAreaModule, ViewpointModule, Z3Module, convertDirection, Z3Solver, Z3SolverContext, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, GalaxySymbol, HiddenSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MultiEntrySymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, };
110
+ export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, Direction, MajorRule, Mode, ORIENTATIONS, Orientation, State, WRAPPINGS, Wrapping, directionToggle, orientationToggle, MetadataSchema, PuzzleSchema, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, CustomRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerV0, getShapeVariants, normalizeShape, positionsToShape, shapeEquals, tilesToShape, allSolvers, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, EventIteratingSolver, Solver, UniversalSolver, AreaNumberModule, CellCountModule, ConnectAllModule, DartModule, allZ3Modules, LetterModule, MyopiaModule, RegionAreaModule, ViewpointModule, Z3Module, convertDirection, Z3Solver, Z3SolverContext, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, FocusSymbol, GalaxySymbol, HiddenSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MultiEntrySymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logic-pad/core",
3
- "version": "0.6.1",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",