From 02f71b27bde9acc70c13528b9524b6d233e735af Mon Sep 17 00:00:00 2001 From: Paalui Date: Mon, 8 Jul 2024 16:23:06 +0200 Subject: [PATCH 1/3] Added rounding in the condition function This fixes #353, but its only done in the condition so inaccuracies could still add up. --- the-one-true-todey-file-of-cellpond.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/the-one-true-todey-file-of-cellpond.js b/the-one-true-todey-file-of-cellpond.js index 756eefd..cfc0125 100644 --- a/the-one-true-todey-file-of-cellpond.js +++ b/the-one-true-todey-file-of-cellpond.js @@ -2165,10 +2165,10 @@ on.load(() => { const neighbour = pickCell(centerX, centerY) if (neighbour === undefined) return [undefined, undefined] - if (neighbour.left !== x) return [undefined, undefined] - if (neighbour.top !== y) return [undefined, undefined] - if (neighbour.width !== width) return [undefined, undefined] - if (neighbour.height !== height) return [undefined, undefined] + if (neighbour.left+8 !== x+8) return [undefined, undefined] + if (neighbour.top+8 !== y+8) return [undefined, undefined] + if (neighbour.width+8 !== width+8) return [undefined, undefined] + if (neighbour.height+8 !== height+8) return [undefined, undefined] if (!splashes.has(neighbour.colour)) return [undefined, undefined] return [neighbour, cell.content.stamp] From 62c4535a070659f0ea2af2fdd873b9e5ae6f52b3 Mon Sep 17 00:00:00 2001 From: Paalui Date: Mon, 8 Jul 2024 16:46:42 +0200 Subject: [PATCH 2/3] Fixed merging in the ResultsFunction After a merge instruction the cells get skipped one at a time causing the next instructions to be applied on every second of the already deleted/merged cells cells. --- the-one-true-todey-file-of-cellpond.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/the-one-true-todey-file-of-cellpond.js b/the-one-true-todey-file-of-cellpond.js index cfc0125..002d041 100644 --- a/the-one-true-todey-file-of-cellpond.js +++ b/the-one-true-todey-file-of-cellpond.js @@ -2257,8 +2257,8 @@ on.load(() => { if (bonusTargets.length === 0) { neighbourId++ if (skip > 0) { - neighbourId++ - skip-- + neighbourId+= skip + skip = 0 } } } From a4dce1abefa95ea03b91f563e4ac502c1b810cdf Mon Sep 17 00:00:00 2001 From: Paalui Date: Mon, 8 Jul 2024 17:05:40 +0200 Subject: [PATCH 3/3] Multicells got merged if the right side was empty When updating paddle rules, if there is a multicell on the left hand it always gets merged first, even if there is nothing in the right side. I changed it to add a nothing instrution for every minicell instead of merging if the cell shouldn't change. --- the-one-true-todey-file-of-cellpond.js | 41 ++++++++++++++++++-------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/the-one-true-todey-file-of-cellpond.js b/the-one-true-todey-file-of-cellpond.js index 002d041..df09e37 100644 --- a/the-one-true-todey-file-of-cellpond.js +++ b/the-one-true-todey-file-of-cellpond.js @@ -8310,6 +8310,7 @@ registerRule( //======// // LEFT // //======// + let miniCount = 0 if (cellAtom.isLeftSlot) { const red = makeNumber({values: [true, true, true, true, true, true, true, true, true, true], channel: 0}) @@ -8337,6 +8338,7 @@ registerRule( content: miniClone, }) left.push(diagramCell) + miniCount++ } } else { @@ -8352,24 +8354,39 @@ registerRule( //=======// // RIGHT // //=======// + const rightContent = cellAtom.slotted === undefined? undefined : cellAtom.slotted.value // Merge!!! if (!cellAtom.isLeftSlot && cellAtom.value.isDiagram) { - const maxiLeft = makeMaximisedDiagram(cellAtom.value) - const [maxiWidth, maxiHeight] = getDiagramDimensions(maxiLeft) - const mergeCell = makeDiagramCell({ - x, - y, - instruction: DRAGON_INSTRUCTION.merge, - splitX: maxiWidth, - splitY: maxiHeight, - }) - - right.push(mergeCell) + if (rightContent === undefined) { + while(miniCount>1){ + const nothingCell = makeDiagramCell({ + x, + y, + instruction: DRAGON_INSTRUCTION.nothing, + }) + + right.push(nothingCell) + miniCount-- + } + } + else{ + const maxiLeft = makeMaximisedDiagram(cellAtom.value) + const [maxiWidth, maxiHeight] = getDiagramDimensions(maxiLeft) + + const mergeCell = makeDiagramCell({ + x, + y, + instruction: DRAGON_INSTRUCTION.merge, + splitX: maxiWidth, + splitY: maxiHeight, + }) + + right.push(mergeCell) + } } - const rightContent = cellAtom.slotted === undefined? undefined : cellAtom.slotted.value if (rightContent === undefined) { const nothingCell = makeDiagramCell({