This software is copyright (c) 2004-2024 Simon Tatham.

Portions copyright Richard Boulton, James Harvey, Mike Pinna, Jonas
Kölker, Dariusz Olszewski, Michael Schierl, Lambros Lambrou, Bernd
Schmidt, Steffen Bauer, Lennard Sprong, Rogier Goossens, Michael
Quevillon, Asher Gordon, Didi Kohen, Ben Harris and Anders Höglund.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Net JavaScript adaptation scope
------------------------------
The algorithms in js/core.js, js/solver.js and js/generator.js adapt Net
from Simon Tatham's Portable Puzzle Collection (net.c), including its
rotation and adjacency rules, disjoint-set connectivity constraints,
logical orientation pruning, centre-grown spanning trees, perimeter
perturbation, progress-based regeneration, and loop-aware shuffling.
Disjoint-set and loop-detection behaviour correspond to the upstream
dsf.c and findloop.c helpers; the local loop-edge implementation uses
Tarjan bridge detection rather than copying those helper libraries.

This adaptation implements only square, non-wrapping boards without
barriers. Solver certainty and perturbation markers are separate from
player locks. JavaScript arrays replace the upstream tree containers,
and a seeded JavaScript random generator replaces the upstream RNG;
identical seeds are not expected to reproduce the C implementation.
The browser UI, worker protocol and persistence integration are local
adaptations, not the upstream puzzle frontend.

Original project: https://www.chiark.greenend.org.uk/~sgtatham/puzzles/
