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

Penrose tiling support #172

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Penrose tiling support #172

wants to merge 7 commits into from

Conversation

blotwell
Copy link

This adds basic support for Penrose rhombus tilings. You can change the default 5-fold symmetry to higher-order equivalent (e.g. 7-fold).

Like with the other tilings already marked as "alpha", some of the detailed support for specific puzzle types is lacking at the moment. But at least connectivity of cells/edges/vertices works. Cursor key navigation in number mode is also supported.

@ABcDexter
Copy link

Nice :)

@swaroopg92
Copy link
Owner

@blotwell Thanks for the PR. I started reviewing this. One thing i noticed, In Sudoku mode, clicking or moving cells it is selecting behind the scenes but the selection not showing up visually. I will look into it eventually but thought to mention it here, in case you already know the reason/fix it.

@blotwell
Copy link
Author

blotwell commented Sep 16, 2024

Thanks @swaroopg92. I looked into this (it's also broken in two of the other grid types, that's partly why I didn't feel guilty enough to fix it before :)) and the reason is that grid types are enumerated in draw_selection() with the default action being effectively to draw nothing. The basic fix would be this:

diff --git a/docs/js/class_p.js b/docs/js/class_p.js
index b49d2a1..f511c9c 100644
--- a/docs/js/class_p.js
+++ b/docs/js/class_p.js
@@ -12112,7 +12112,7 @@ class Puzzle {
                 } else if (this.gridtype === "iso") {
                     factor = 0;
                     offset = 0;
-                } else if (this.gridtype === "tetrakis_square" || this.gridtype === "cairo_pentagonal") {
+                } else if (this.gridtype === "tetrakis_square" || this.gridtype === "cairo_pentagonal" || this.gridtype === "rhombitrihexagonal" || this.gridtype === "deltoidal_trihexagonal" || this.gridtype === "penrose_P3") {
                     factor = 0;
                     offset = 0;
                 } else {
@@ -12631,4 +12631,4 @@ class Puzzle {
         return !this.version_gt(major, minor, revision);
     }

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.

3 participants