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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## History
* unreleased
* Support for Penrose rhombus ("P3") tilings.
* 2024/07/16 ver 3.1.4
* Code refactoring.
* Added non-alphanumeric genre tag to allow answer check on non-alphanumeric characters.
Expand Down
6 changes: 6 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ <h4><label class="label_nb" id="nb_gridtype_lb">Board type:</label></h4>
<option value="cairo_pentagonal" id="nb_gridtype11_lb"> Cairo pentagonal </option>
<option value="rhombitrihexagonal" id="nb_gridtype12_lb"> Rhombitrihexagonal </option>
<option value="deltoidal_trihexagonal" id="nb_gridtype13_lb"> Deltoidal trihexagonal </option>
<option value="penrose_P3" id="nb_gridtype14_lb"> Penrose P3 </option>
</select>
</span><br>
<h4><label class="label_nb" id="nb_size_lb">Size:</label></h4>
Expand All @@ -836,13 +837,18 @@ <h4><label class="label_nb" id="nb_size_lb">Size:</label></h4>
<span><label class="label_nb" id="nb_sudoku3_lb">Outside clues (top/left)</label></span>
<input type="checkbox" name="nb_sudoku3" id="nb_sudoku3">
<br>
<span><label class="label_nb" id="nb_penrose1_lb">Rotational asymmetry</label></span>
<input type="number" pattern="\d*" name="nb_penrose1" id="nb_penrose1" value="0" min="0" max="30" step="1">
<span><label class="label_nb" id="nb_sudoku8_lb">Size 4x4</label></span>
<input type="checkbox" name="nb_sudoku8" id="nb_sudoku8">
<span><label class="label_nb" id="nb_sudoku5_lb">Size 6x6</label></span>
<input type="checkbox" name="nb_sudoku5" id="nb_sudoku5">
<span><label class="label_nb" id="nb_sudoku6_lb">Size 8x8</label></span>
<input type="checkbox" name="nb_sudoku6" id="nb_sudoku6">
<br>
<span><label class="label_nb" id="nb_penrose2_lb">Tiling seed</label></span>
<input type="number" pattern="\d*" name="nb_penrose2" id="nb_penrose2" value="0.1" min="0.001" max="0.999" step="0.001" oninput="nb_penrose2_sl.value = nb_penrose2.value">
<input type="range" id="nb_penrose2_sl" value="0.1" min="0.001" max="0.999" step="0.001" oninput="nb_penrose2.value = nb_penrose2_sl.value">
<span><label class="label_nb" id="nb_sudoku7_lb"></label></span>
</span>
<br>
Expand Down
8 changes: 5 additions & 3 deletions docs/js/class_p.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class Puzzle {
'snub': 20,
'cairo': 20,
'rhombitrihex': 20,
'deltoidal': 20
'deltoidal': 20,
'penrose': 20
}; // also defined in general.js
this.replace = [
["\"qa\"", "z9"],
Expand Down Expand Up @@ -8720,7 +8721,8 @@ class Puzzle {
if (this.selection.length === 1 && parseInt(this.selection[0] / (this.nx0 * this.ny0)) > 0 &&
this.gridtype !== "iso" && this.gridtype !== "tetrakis_square" && this.gridtype !== "truncated_square" &&
this.gridtype !== "snub_square" && this.gridtype !== "cairo_pentagonal" &&
this.gridtype !== "rhombitrihexagonal" && this.gridtype !== "deltoidal_trihexagonal") {
this.gridtype !== "rhombitrihexagonal" && this.gridtype !== "deltoidal_trihexagonal" &&
this.gridtype !== "penrose_P3") {
// do nothing
} else if (!this.selection.includes(num) & this.drawing) {
this.selection.push(num);
Expand Down Expand Up @@ -12110,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 {
Expand Down
Loading