Skip to content

Commit

Permalink
v0.60
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
viresh-ratnakar authored Apr 2, 2020
1 parent d572359 commit d4eeb9f
Show file tree
Hide file tree
Showing 18 changed files with 94 additions and 60 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion exolve-m.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions exolve-m.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Exolve: An Easily Configurable Interactive Crossword Solver</title>

Expand Down
23 changes: 18 additions & 5 deletions exolve-m.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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)) {
Expand All @@ -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
}
Expand Down Expand Up @@ -2572,7 +2584,8 @@ function addOrphanEntryUI(elt, inCurr, len, placeholder, clueIndex) {
}
html = html + ' class="nobr">' +
'<input size="' + len + '" class="incluefill" placeholder="' +
placeholder + '" type="text" ' +
placeholder.replace(/\?/g, '·') +
'" type="text" ' +
'oninput="updateOrphanEntry(\'' + clueIndex + '\', ' + inCurr + ')" ' +
'title="You can record your solution here before copying to squares" ' +
'autocomplete="off" spellcheck="off"></input>'
Expand Down
23 changes: 18 additions & 5 deletions exolve.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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)) {
Expand All @@ -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
}
Expand Down Expand Up @@ -2663,7 +2675,8 @@
}
html = html + ' class="nobr">' +
'<input size="' + len + '" class="incluefill" placeholder="' +
placeholder + '" type="text" ' +
placeholder.replace(/\?/g, '·') +
'" type="text" ' +
'oninput="updateOrphanEntry(\'' + clueIndex + '\', ' + inCurr + ')" ' +
'title="You can record your solution here before copying to squares" ' +
'autocomplete="off" spellcheck="off"></input>'
Expand Down
6 changes: 3 additions & 3 deletions test-15x15-unsolved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-15x15</title>

Expand Down
6 changes: 3 additions & 3 deletions test-3d-solved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-3D</title>

Expand Down
6 changes: 3 additions & 3 deletions test-basic-solved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Basic</title>

Expand Down
6 changes: 3 additions & 3 deletions test-basic-unsolved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Basic</title>

Expand Down
6 changes: 3 additions & 3 deletions test-customize-puzzle.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<script>
function customizePuzzle() {
Expand Down
14 changes: 7 additions & 7 deletions test-diagramless-solved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Diagramless</title>

Expand All @@ -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======
`;
Expand Down
6 changes: 3 additions & 3 deletions test-diagramless-unsolved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Diagramless</title>

Expand Down
6 changes: 3 additions & 3 deletions test-jigsaw-solved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Jigsaw</title>

Expand Down
6 changes: 3 additions & 3 deletions test-jigsaw-unsolved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Jigsaw</title>

Expand Down
6 changes: 3 additions & 3 deletions test-linked-solved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Linked</title>

Expand Down
6 changes: 3 additions & 3 deletions test-linked-unsolved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Linked</title>

Expand Down
16 changes: 8 additions & 8 deletions test-mixed-solved.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->

<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.59"/>
<script src="exolve-m.js?v0.59"></script>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v0.60"/>
<script src="exolve-m.js?v0.60"></script>

<title>Test-Mixed</title>

Expand Down Expand Up @@ -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)
[&#128274;] Jolt (4)
[B] Annul (3,2)
[C] Skeletal (4-4)
[d, p, q] Hereto (6) HERETO.
[E, F, G] Yammers (7)
[&#128274;, &#128274;, &#128274;] Jolt (4)
[&#128273;] Above (5)
exolve-end
`;
Expand Down

0 comments on commit d4eeb9f

Please sign in to comment.