Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-squares in multi-squares in ... #362

Merged
merged 4 commits into from
Jan 24, 2025
Merged

Conversation

Paalui
Copy link
Contributor

@Paalui Paalui commented Sep 7, 2024

Did this a while ago, but wanted to find a neater solution. Didn't find one and forgot to do it so ill just PR it now if you want to use it.

I did:

Stuff i am not happy with/ is janky:

  • The merge instruction merges m∗n cells. When i want to merge this: ⊞⊟ it isn't m∗n. Because the merge instruction is inplemented by merging next m∗n cells, i just tell it to merge n∗1 cells (6∗1 in the case of ⊞⊟).
  • I implemented almost the same thing three times.
    • flattenAndFillDiagramCells it flattens nested cells and fills the voids.
    • addDiagramCellsToLeftList it does the same but for rule gen on the left side. Also it returns what structure the nested cell had.
    • addDiagramCellsToRightList it does the same but for rule gen on the right side and it uses the structure to tell when merge/split
  • Because the rule update needs nested cells, multi-cells have to be flattened every time they get used else where (in the splitCellToDiagram function).

Paalui added 4 commits July 9, 2024 01:30
I changed the splitCellToDiagram and the updatePaddleRule function to go recursivcely through all diagrams. Also empty cells in a diagram get replaced with a cell.
If a cell on both sides are split the same they only get recoloured.
If they are split the same but they have a different multi-multi cell structure it still merges and splits.
eg: left has a 1x4 multicell and right has 1x2 multi cell with 1x2 multi cells in it. That still doesn't work.
Copy link

netlify bot commented Sep 7, 2024

Deploy Preview for keen-boyd-1443aa ready!

Name Link
🔨 Latest commit ebab6c7
🔍 Latest deploy log https://app.netlify.com/sites/keen-boyd-1443aa/deploys/66dbab0171cf2900088cd5ac
😎 Deploy Preview https://deploy-preview-362--keen-boyd-1443aa.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@TodePond
Copy link
Owner

TodePond commented Jan 5, 2025

Hey this looks great. i'll pop in some questions slowly over time

@TodePond
Copy link
Owner

TodePond commented Jan 5, 2025

and sorry im so slow :)

Comment on lines +8247 to +8250
if (a.x + 128 < b.x + 128) return -1
if (a.x + 128 > b.x + 128) return 1
if (a.y + 128 < b.y + 128) return -1
if (a.y + 128 > b.y + 128) return 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for this change?

Copy link
Contributor Author

@Paalui Paalui Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it to round the numbers by a bit. So if the bottom cell was .000000001 more to the left it wouldn't be before the top.
I don't fully know how i got a cell that was a bit offset, so don't know if it can still happen / it would be a better idea to round it somewhere else.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh fantastic good idea!

yes I think it would be better to do this change at cell creation time, rather than during this hot function, but i am happy to merge the PR as it is and we can see

@TodePond TodePond merged commit 770569c into TodePond:main Jan 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A multi-square in a multi-square doesn't get brushed properly
2 participants