From d4eeb9f1395ecbdc32e72bd0472522add069deb3 Mon Sep 17 00:00:00 2001
From: Viresh Ratnakar <39968616+viresh-ratnakar@users.noreply.github.com>
Date: Wed, 1 Apr 2020 17:33:59 -0700
Subject: [PATCH] v0.60
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
### Version: Exolve v0.60 April 1 2020
- For orphan clue placeholders, use middle dots (···) instead of question marks
(???) so that filled placeholders can more readily be visually distinguished
from unfilled ones.
- Minor bugfixes for linked clue number rendering, when the linked numbers
are non-numeric.
---
CHANGELOG.md | 8 ++++++++
README.md | 2 +-
exolve-m.css | 2 +-
exolve-m.html | 6 +++---
exolve-m.js | 23 ++++++++++++++++++-----
exolve.html | 23 ++++++++++++++++++-----
test-15x15-unsolved.html | 6 +++---
test-3d-solved.html | 6 +++---
test-basic-solved.html | 6 +++---
test-basic-unsolved.html | 6 +++---
test-customize-puzzle.html | 6 +++---
test-diagramless-solved.html | 14 +++++++-------
test-diagramless-unsolved.html | 6 +++---
test-jigsaw-solved.html | 6 +++---
test-jigsaw-unsolved.html | 6 +++---
test-linked-solved.html | 6 +++---
test-linked-unsolved.html | 6 +++---
test-mixed-solved.html | 16 ++++++++--------
18 files changed, 94 insertions(+), 60 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fbf4d8b4..ea43fd22 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+### Version: Exolve v0.60 April 1 2020
+
+- For orphan clue placeholders, use middle dots (···) instead of question marks
+ (???) so that filled placeholders can more readily be visually distinguished
+ from unfilled ones.
+- Minor bugfixes for linked clue number rendering, when the linked numbers
+ are non-numeric.
+
### Version: Exolve v0.59 April 1 2020
- Do proper styling of clue numbers for linked clues: let them spill into
diff --git a/README.md b/README.md
index 6f9a7e80..f8356d0f 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
## An Easily Configurable Interactive Crossword Solver
-### Version: Exolve v0.59 April 1 2020
+### Version: Exolve v0.60 April 1 2020
The file *exolve.html* contains *all* the code you need: just make a copy and
then replace the part that contains the example grid with your own puzzle
diff --git a/exolve-m.css b/exolve-m.css
index e05344eb..50d9796a 100644
--- a/exolve-m.css
+++ b/exolve-m.css
@@ -5,7 +5,7 @@ Copyright (c) 2019 Viresh Ratnakar
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
*/
.background {
diff --git a/exolve-m.html b/exolve-m.html
index af90f17e..28253a7c 100644
--- a/exolve-m.html
+++ b/exolve-m.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Exolve: An Easily Configurable Interactive Crossword Solver
diff --git a/exolve-m.js b/exolve-m.js
index 899b14e1..cfa23698 100644
--- a/exolve-m.js
+++ b/exolve-m.js
@@ -25,7 +25,7 @@ The latest code and documentation for exolve can be found at:
https://github.com/viresh-ratnakar/exolve
*/
-const VERSION = 'Exolve v0.59 April 1 2020'
+const VERSION = 'Exolve v0.60 April 1 2020'
// ------ Begin globals.
@@ -1829,11 +1829,12 @@ function displayClues() {
let col1 = document.createElement('td')
col1.innerHTML = clues[clueIndex].displayLabel
- let col1Chars = clues[clueIndex].displayLabel.replace(/&.*;/g, 'X')
+ let col1Chars = clues[clueIndex].displayLabel.replace(/&[^;]*;/g, '#')
let col1NumChars = [...col1Chars].length
if (col1Chars.substr(1,1) == ',') {
// Linked clue that begins with a single-digit clue number. Indent!
col1.style.textIndent = '1ch'
+ col1Chars = '0' + col1Chars
col1NumChars++
}
if (!allCellsKnown(clueIndex)) {
@@ -1845,9 +1846,20 @@ function displayClues() {
col2.innerHTML = clues[clueIndex].clue
if (col1NumChars > 2) {
// More than two unicode chars in col1. Need to indent col2.
+ col1Chars = col1Chars.substr(2)
+ // spaces and equal number of commas use 4
let col1Spaces = col1Chars.split(' ').length - 1
- let indent = (col1NumChars - 2 - (2 * col1Spaces)) * 8
- indent = indent + (2 * col1Spaces * 4)
+ let indent = col1Spaces * 2 * 4
+ // digits use 8
+ let col1Digits = col1Chars.replace(/[^0-9]*/g, '').length
+ indent = indent + (col1Digits * 8)
+ // letters use 11
+ let col1Letters = col1Chars.replace(/[^a-zA-Z]*/g, '').length
+ indent = indent + (col1Letters * 11)
+ let rem = col1Chars.length - col1Letters - col1Digits - (2 * col1Spaces);
+ if (rem > 0) {
+ indent = indent + (rem * 14)
+ }
if (indent < 4) {
indent = 4
}
@@ -2572,7 +2584,8 @@ function addOrphanEntryUI(elt, inCurr, len, placeholder, clueIndex) {
}
html = html + ' class="nobr">' +
''
diff --git a/exolve.html b/exolve.html
index 0c2a326d..f4863f37 100644
--- a/exolve.html
+++ b/exolve.html
@@ -116,7 +116,7 @@
======REPLACE WITH YOUR PUZZLE ABOVE======
`;
-const VERSION = 'Exolve v0.59 April 1 2020'
+const VERSION = 'Exolve v0.60 April 1 2020'
// ------ Begin globals.
@@ -1920,11 +1920,12 @@
let col1 = document.createElement('td')
col1.innerHTML = clues[clueIndex].displayLabel
- let col1Chars = clues[clueIndex].displayLabel.replace(/&.*;/g, 'X')
+ let col1Chars = clues[clueIndex].displayLabel.replace(/&[^;]*;/g, '#')
let col1NumChars = [...col1Chars].length
if (col1Chars.substr(1,1) == ',') {
// Linked clue that begins with a single-digit clue number. Indent!
col1.style.textIndent = '1ch'
+ col1Chars = '0' + col1Chars
col1NumChars++
}
if (!allCellsKnown(clueIndex)) {
@@ -1936,9 +1937,20 @@
col2.innerHTML = clues[clueIndex].clue
if (col1NumChars > 2) {
// More than two unicode chars in col1. Need to indent col2.
+ col1Chars = col1Chars.substr(2)
+ // spaces and equal number of commas use 4
let col1Spaces = col1Chars.split(' ').length - 1
- let indent = (col1NumChars - 2 - (2 * col1Spaces)) * 8
- indent = indent + (2 * col1Spaces * 4)
+ let indent = col1Spaces * 2 * 4
+ // digits use 8
+ let col1Digits = col1Chars.replace(/[^0-9]*/g, '').length
+ indent = indent + (col1Digits * 8)
+ // letters use 11
+ let col1Letters = col1Chars.replace(/[^a-zA-Z]*/g, '').length
+ indent = indent + (col1Letters * 11)
+ let rem = col1Chars.length - col1Letters - col1Digits - (2 * col1Spaces);
+ if (rem > 0) {
+ indent = indent + (rem * 14)
+ }
if (indent < 4) {
indent = 4
}
@@ -2663,7 +2675,8 @@
}
html = html + ' class="nobr">' +
''
diff --git a/test-15x15-unsolved.html b/test-15x15-unsolved.html
index e33c35a9..e7537995 100644
--- a/test-15x15-unsolved.html
+++ b/test-15x15-unsolved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-15x15
diff --git a/test-3d-solved.html b/test-3d-solved.html
index d19ea7f3..5509c117 100644
--- a/test-3d-solved.html
+++ b/test-3d-solved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-3D
diff --git a/test-basic-solved.html b/test-basic-solved.html
index c3acaff3..88930ade 100644
--- a/test-basic-solved.html
+++ b/test-basic-solved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-Basic
diff --git a/test-basic-unsolved.html b/test-basic-unsolved.html
index 06a5d14e..a00792cd 100644
--- a/test-basic-unsolved.html
+++ b/test-basic-unsolved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-Basic
diff --git a/test-customize-puzzle.html b/test-customize-puzzle.html
index 47e10923..74583b1e 100644
--- a/test-customize-puzzle.html
+++ b/test-customize-puzzle.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
+
+
Test-Diagramless
@@ -36,11 +36,11 @@
A*.*.*E*
R*A*I*D*
exolve-across:
- 1 crew (4)
- 3 raid (4)
+ 1 crew (4) CREW
+ 3 raid (4) RAID
exolve-down
- 1 car (3)
- 2 wed (3)
+ 1 car (3) CAR some anno
+ 2 wed (3) WED blah
exolve-end
======REPLACE WITH YOUR PUZZLE ABOVE======
`;
diff --git a/test-diagramless-unsolved.html b/test-diagramless-unsolved.html
index 4435e619..221eaed5 100644
--- a/test-diagramless-unsolved.html
+++ b/test-diagramless-unsolved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-Diagramless
diff --git a/test-jigsaw-solved.html b/test-jigsaw-solved.html
index 3132a12f..1f605689 100644
--- a/test-jigsaw-solved.html
+++ b/test-jigsaw-solved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-Jigsaw
diff --git a/test-jigsaw-unsolved.html b/test-jigsaw-unsolved.html
index fa5b6466..ad0e16ce 100644
--- a/test-jigsaw-unsolved.html
+++ b/test-jigsaw-unsolved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-Jigsaw
diff --git a/test-linked-solved.html b/test-linked-solved.html
index b4a8ca1a..72a2966b 100644
--- a/test-linked-solved.html
+++ b/test-linked-solved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-Linked
diff --git a/test-linked-unsolved.html b/test-linked-unsolved.html
index 752aca3a..e9eb9024 100644
--- a/test-linked-unsolved.html
+++ b/test-linked-unsolved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-Linked
diff --git a/test-mixed-solved.html b/test-mixed-solved.html
index 7f7538d0..604beb1d 100644
--- a/test-mixed-solved.html
+++ b/test-mixed-solved.html
@@ -11,11 +11,11 @@
See the full license notice in exolve-m.js.
-Version: Exolve v0.59 April 1 2020
+Version: Exolve v0.60 April 1 2020
-->
-
-
+
+
Test-Mixed
@@ -84,11 +84,11 @@
24 Chaos (5)
exolve-nodir
[A] CHECK "clear/reveal this" enabled Subsidies (9) SUBSIDIES. Some bogus anno.
- [B] Annul (5)
- [C] Skeletal (8)
- [D] Hereto (6) HERETO.
- [E] Yammers (7)
- [🔒] Jolt (4)
+ [B] Annul (3,2)
+ [C] Skeletal (4-4)
+ [d, p, q] Hereto (6) HERETO.
+ [E, F, G] Yammers (7)
+ [🔒, 🔒, 🔒] Jolt (4)
[🔑] Above (5)
exolve-end
`;