Extended logic puzzle solver of Noq.
@T0nyX1ang: backend, frontend, new solver implementations, bug fixes
@zhuyaoyu: (huge) solver optimizations, new solver implementations, bug fixes
Remove redundant codes and formatting codes.
New solver backend with new UI design (See issue #2)
Change the backend from Django to Starlette with Uvicorn (See issue #31, #50).
Change the frontend from Noq native to penpa-edit. (See issue #36).
Select puzzle type.
Show rules in puzz.link if possible.
Choose example puzzle.
Show/Edit parameters of the solver if possible.
Solve/Reset the puzzle.
Note: if the puzzle is imported from puzz.link, you will need to change the edit mode to Problem
to reset the puzzle itself.
Install uv first.
Clone this project and switch to master
branch.
git clone https://github.com/T0nyX1ang/noqx.git
uv venv
uv sync --no-dev
uv run noqx.py
pip install -r requirements.txt
master
branch. git clone https://github.com/T0nyX1ang/noqx.git
py -3 noqx.py
python3 noqx.py
usage: noqx.py [-h] [-d] [-H HOST] [-p PORT] [-tl TIME_LIMIT]
optional arguments:
-h, --help show this help message and exit
-H HOST, --host HOST the host to run the server on.
-p PORT, --port PORT the port to run the server on.
-d, --debug whether to enable debug mode with auto-reloading.
-tl TIME_LIMIT, --time_limit TIME_LIMIT
time limit in seconds (default = 30).
-pt PARALLEL_THREADS, --parallel_threads PARALLEL_THREADS
parallel threads (default = 1).
Install uv first.
Clone this project and switch to dev
branch.
git clone https://github.com/T0nyX1ang/noqx.git
git checkout dev
uv sync
uv pre-commit install
Create a python file in solver/
and write solver codes in that file. The functions in noqx
package are free to use.
(Optional) Append a __metadata__
variable in the end of the solver file. The keys of __metadata__
are:
name
: the name of the solver.category
: the category of the solver, should be shade
(Shading), loop
(Loop / Path), region
(Area Division), num
(Number), var
(Variety), draw
(Drawing), unk
(Unknown).examples
(Optional): a list of examples of the solver, each example can be created in two conflicting ways, data
and url
:data
: directly draw the board in noqx and get the data URL by using Share → Editing URL → Copy
.url
: draw the board in puzz.link and use File → Export URL
to get the board URL.config
(Optional): the configuration of the solver, which will be passed to the solver when it is created, and the keys of config
are the same as parameters
keys.test
(Optional): whether the example is a test case, the default value is True
, and cannot be used together with url
way.parameters
(Optional): the parameters of the solver, which will be passed to the solver when it is created.Free to PR now ^_^
unittest
features) with uv: uv run coverage run -m unittest
uv run coverage html