Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualising and Modelling Puzzles - Demystify-rs #18

Open
ChrisJefferson opened this issue Sep 2, 2024 · 2 comments
Open

Visualising and Modelling Puzzles - Demystify-rs #18

ChrisJefferson opened this issue Sep 2, 2024 · 2 comments

Comments

@ChrisJefferson
Copy link

demystify-rs is a Rust program for explaining pen and paper puzzles like Sudoku (what makes something a 'pen and paper' puzzle? You could print it out, and solve it with pen and paper :) )

It uses conjure (not conjure-oxide yet, but it will when conjure-oxide can refine all of conjure in the future), to translate puzzles to SAT, and then uses 'Minimal Unsatisfiable Sets' to solve those puzzles and (hopefully) explain how to solve them in a human-solvable way.

Demystify renders puzzles as SVGs (SVG is a format for drawing lines, circles, and text. It is commonly used on the internet). At the moment, there are 2 main issues

  • The SVGs are not very good.
  • There are a wide range of puzzles, with many different visual features. It would be good to implement as many as possible, and implement a generic framework for expressing puzzles.

I am happy to discuss this project, but the main objects I see are:

  • Make a catalog of pen and paper puzzles
  • Make a simple "visual language' to describe how to draw pen and paper puzzles.
  • Extend the SVG output to render these puzzles, and explanations of these puzzles, well.

I do not expect the programming in this project to be highly difficult. It will require learning some basic SVG functionality.

I am happy to talk further about this project, and also give access to the repository for demystify-rs.

(Note, there is an earlier system, called 'demystify', written in Python. This has been replaced by a better, more general, Rust system).

To give you an idea of what demystify outputs look like, I attach to example outputs, but demystify implements about 14 puzzles types, and adding more is easy (but, they currently aren't drawn well! Also, they are very verbose...)
examples.zip

@ChrisJefferson
Copy link
Author

image

Here is a sample image, just to show the kind of thing demystify current outputs (in this puzzle, binairo, each row and each column must contain three 0s (which should be 'black') and three 1s (which should be 'white'). As the row must be at least half black, then the last remaining cell which we can choose a value for must be 0.

@ChrisJefferson
Copy link
Author

ChrisJefferson commented Sep 2, 2024

image

Here is another problem Star Battle, this is much more complicated deduction. In this problem we use 3 constraints:

  1. There must be one thing which is '1' on row 2 (the '1' represents a star), there are two candidate spaces.

  2. Stars cannot be adjacent, and the two squares in row 2 which could contain a star are both adjacent to (3,5)

So, (3,5) can't contain a star.

@ChrisJefferson ChrisJefferson changed the title Visualising and Collecting Puzzles - Demystify-rs Visualising and Modelling Puzzles - Demystify-rs Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant