Skip to content

Commit

Permalink
Use corner numbers for maxi loop and detour puzz.link import
Browse files Browse the repository at this point in the history
  • Loading branch information
nmay231 committed Oct 6, 2021
1 parent 24463d8 commit 518a771
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docs/js/general.js
Original file line number Diff line number Diff line change
@@ -2854,8 +2854,19 @@ function decode_puzzlink(url) {
info_number = puzzlink_pu.moveNumbersToRegionCorners(info_edge, info_number);

puzzlink_pu.drawBorder(pu, info_edge, 2);
number_style = type === "country" ? "1" : "6"; // Normal or Small number
puzzlink_pu.drawNumbers(pu, info_number, 1, number_style);

if (type === "country") {
puzzlink_pu.drawNumbers(pu, info_number, 1, "1");
} else {
// Draw numbers in the corner
for (var i in info_number) {
// Determine which row and column
row_ind = parseInt(i / cols);
col_ind = i % cols;
cell = 4 * (pu.ny0 * pu.nx0 + pu.nx0 * (2 + row_ind) + 2 + col_ind);
pu["pu_q"].numberS[cell] = [info_number[i], 1];
}
}

pu.mode_qa("pu_a");
pu.mode_set("combi");

0 comments on commit 518a771

Please sign in to comment.