Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Swaroop Guggilam committed Jun 3, 2022
2 parents a726fd6 + 74fcf8c commit 86c6694
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## History
* 2022/06/02 ver 2.26.20
* Implicit edges for region division puzzles solved using Shading.
* Improvement to size of Sudoku Mode buttons for Mobile Devices.
* Shortcuts to help button.
* Display and Design improvements.
* Bug fixes.
* 2022/04/30 ver 2.26.19
* Added more puzz link support - kropki, firefly, slant, spiral galaxies, ringring, doubleback, yinyang, hitori, putteria, hanare, aho, shikaku, fillmat, lookair, paintarea, sukoro, sukkororoom, usotatami, usoone, scrin, hebiichigo, tasquare, minesweeper, ichimaga, magneticichimaga, crossingichimaga, territory, doublechoco, tateboyokobo, canalview, chocobanana, tonttiraja, dotchiloop, chainedblock, oneroomonedoor, rassisilai
* Added gif download feature to replay
Expand Down
2 changes: 1 addition & 1 deletion docs/css/base-structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ input[type=number] {
.shortcuts th,
.shortcuts td {
color: var(--blue);
border: 1px solid var(--fgMain);
border: 1px solid var(--blackLight);
}

#answersetting {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Local styles -->
<script>
var ver = "2.26.19"; // Also defined in class_p.js
var ver = "2.26.20"; // Also defined in class_p.js
let style_sources = [
"./css/light_theme.css",
"./css/base-structure.css",
Expand Down
112 changes: 110 additions & 2 deletions docs/js/class_p.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class Puzzle {
["\"__a\"", "z_"],
["null", "zO"],
];
this.version = [2, 26, 19]; // Also defined in HTML Script Loading in header tag to avoid Browser Cache Problems
this.version = [2, 26, 20]; // Also defined in HTML Script Loading in header tag to avoid Browser Cache Problems
this.undoredo_disable = false;
this.comp = false;
this.multisolution = false;
Expand All @@ -178,6 +178,7 @@ class Puzzle {
13: 1 // Fat dots
};
this.replaycutoff = 60 * 60 * 1000; // 60 minutes
this.surface_2_edge_types = ['pentominous', 'araf', 'spiralgalaxies', 'fillomino'];
}

reset() {
Expand Down Expand Up @@ -3368,6 +3369,60 @@ class Puzzle {
}
}
}

let found = $('#genre_tags_opt').select2("val").some(r => this.surface_2_edge_types.includes(r));
if (found && this.gridtype === 'square') {
// find out the grid position using the frame data
// Note this section of code will work only if thick border frame exists
if (typeof this.row_start == "undefined") {
// Find top left corner and bottom right corner
let topleft = 9999,
bottomright = 0,
numbers;
for (var i in this.frame) {
numbers = i.split(",");
if (topleft >= parseInt(numbers[0])) {
topleft = parseInt(numbers[0]);
}
if (bottomright <= parseInt(numbers[1])) {
bottomright = parseInt(numbers[1]);
}
}
// finding row and column indices
let pointA, pointB;
pointA = topleft - (this.nx0 * this.ny0);
this.col_start = (pointA % this.nx0) - 1; //column
this.row_start = parseInt(pointA / this.nx0) - 1; //row
pointB = bottomright - (this.nx0 * this.ny0);
this.col_end = (pointB % this.nx0) - 1; //column
this.row_end = parseInt(pointB / this.nx0) - 1; //row
}

let present_cell, right_cell, down_cell;
for (var j = 2 + this.row_start; j < this.row_end + 2; j++) {
for (var i = 2 + this.col_start; i < this.col_end + 2; i++) {
present_cell = i + j * (this.nx0);
right_cell = present_cell + 1;
down_cell = Math.max(...this.point[present_cell].adjacent);
if (i != this.col_end + 1) {
if (this[pu].surface[present_cell] &&
this[pu].surface[right_cell] &&
(this[pu].surface[present_cell] !== this[pu].surface[right_cell])) {
sol[2].push(this.point[present_cell].surround[1] + ',' + this.point[present_cell].surround[2] + ',1');
}
}
if (j != this.row_end + 1) {
if (this[pu].surface[present_cell] &&
this[pu].surface[down_cell] &&
(this[pu].surface[present_cell] !== this[pu].surface[down_cell])) {
sol[2].push(this.point[present_cell].surround[3] + ',' + this.point[present_cell].surround[2] + ',1');
}
}
}
}
}
let unique_sol2 = [...new Set(sol[2])];
sol[2] = unique_sol2;
}

if (document.getElementById("sol_wall").checked === true || checkall) {
Expand Down Expand Up @@ -3628,8 +3683,61 @@ class Puzzle {
}
}
}

let found = $('#genre_tags_opt').select2("val").some(r => this.surface_2_edge_types.includes(r));
if (found && this.gridtype === 'square') {
// find out the grid position using the frame data
// Note this section of code will work only if thick border frame exists
if (typeof this.row_start == "undefined") {
// Find top left corner and bottom right corner
let topleft = 9999,
bottomright = 0,
numbers;
for (var i in this.frame) {
numbers = i.split(",");
if (topleft >= parseInt(numbers[0])) {
topleft = parseInt(numbers[0]);
}
if (bottomright <= parseInt(numbers[1])) {
bottomright = parseInt(numbers[1]);
}
}
// finding row and column indices
let pointA, pointB;
pointA = topleft - (this.nx0 * this.ny0);
this.col_start = (pointA % this.nx0) - 1; //column
this.row_start = parseInt(pointA / this.nx0) - 1; //row
pointB = bottomright - (this.nx0 * this.ny0);
this.col_end = (pointB % this.nx0) - 1; //column
this.row_end = parseInt(pointB / this.nx0) - 1; //row
}

let present_cell, right_cell, down_cell;
for (var j = 2 + this.row_start; j < this.row_end + 2; j++) {
for (var i = 2 + this.col_start; i < this.col_end + 2; i++) {
present_cell = i + j * (this.nx0);
right_cell = present_cell + 1;
down_cell = Math.max(...this.point[present_cell].adjacent);
if (i != this.col_end + 1) {
if (this[pu].surface[present_cell] &&
this[pu].surface[right_cell] &&
(this[pu].surface[present_cell] !== this[pu].surface[right_cell])) {
temp_sol.push(this.point[present_cell].surround[1] + ',' + this.point[present_cell].surround[2] + ',1');
}
}
if (j != this.row_end + 1) {
if (this[pu].surface[present_cell] &&
this[pu].surface[down_cell] &&
(this[pu].surface[present_cell] !== this[pu].surface[down_cell])) {
temp_sol.push(this.point[present_cell].surround[3] + ',' + this.point[present_cell].surround[2] + ',1');
}
}
}
}
}
temp_sol.sort();
sol[sol_count] = temp_sol;
let unique_temp_sol = [...new Set(temp_sol)];
sol[sol_count] = unique_temp_sol;
break;
case "wall":
for (var i in this[pu].wall) {
Expand Down

0 comments on commit 86c6694

Please sign in to comment.