Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jecisc/nonogramsolver
A solver of nonograms for https://www.nonograms.org
https://github.com/jecisc/nonogramsolver
Last synced: 4 days ago
JSON representation
A solver of nonograms for https://www.nonograms.org
- Host: GitHub
- URL: https://github.com/jecisc/nonogramsolver
- Owner: jecisc
- License: gpl-3.0
- Created: 2021-02-07T17:40:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-09T14:08:01.000Z (11 months ago)
- Last Synced: 2024-10-31T06:23:46.009Z (about 2 months ago)
- Language: Smalltalk
- Size: 117 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NonogramSolver
A solver of nonograms for https://www.nonograms.orgThis is a work in progress. Some nonogram will be solved but not all of them. It's almost finished but I am too lazy to implement the guess startegy I have in mind for the few ones I cannot solve with strategies
## Installation
To install the project on your Pharo image, execute the following script:
```Smalltalk
Metacello new
githubUser: 'jecisc' project: 'NonogramSolver' commitish: 'main' path: 'src';
baseline: 'NonogramSolver';
load
```## How to use
NonogramSolver uses websockets to connect the web page and fill the nonogram.
The WebSocket on the server side should be initialized during the load part of the project by the method `NSResolver class>>#launchWebSocket`.Then you can select your nonogram on https://www.nonograms.org.
In order to use NonogramSolver to resolve your nonogram, you need to open the javascript console of your browser (F12 on Firefox).
You can copy paste this snippet and execute it:```javascript
const socket = new WebSocket("ws://localhost:1802");socket.addEventListener("open", function (event) {
socket.send(document.getElementsByClassName("nonogram_table")[0].innerHTML);
});socket.addEventListener("message", function (event) {
const data = JSON.parse(event.data);
data.filled.forEach(check);
data.empty.forEach(empty);
});function check(value, index, array) {
var clickEvent = new MouseEvent("mousedown", { view: window, button: 0});
document.getElementById(value).dispatchEvent (clickEvent);
}function empty(value, index, array) {
var clickEvent = new MouseEvent("mousedown", { view: window, button: 2});
document.getElementById(value).dispatchEvent (clickEvent);
}
```## Contact
If you have any questions or problems do not hesitate to open an issue or contact cyril (a) ferlicot.me