swaroopg92 / penpa-edit

Web application to create and solve Sudokus and Puzzles
https://swaroopg92.github.io/penpa-edit/
Other
110 stars 42 forks source link

Puzz.link Support #41

Open swaroopg92 opened 3 years ago

swaroopg92 commented 3 years ago

Users can load puzz.link puzzles into Penpa+ using the "Load" button. It currently supports (not full list, check Readme file for complete list):

nmay231 commented 3 years ago

Hi! I'm willing to contribute one or more of these puzzle parsers. When I can allocate some free time, I'm thinking of adding Heyawake, Slitherlink, Tents, and/or Fillomino.

Thanks for maintaining this awesome piece of software, btw :ok_hand:

swaroopg92 commented 3 years ago

Hi @nmay231, 1) Sure, please go ahead. Submit a PR as you implement. I started this mainly to solve the puzzle genres for which the Penpa interface is more friendly (specially numbered puzzles). But there is no reason not to add other types as well. It's mainly time so I prioritize the above ones which I listed. So your help is greatly appreciated and would be a good addition. No priority for me, feel free to add in any order as you please. Let me know if you have any questions. 2) Composite modes are for solving, so yeah it's intended. To solve a Tent's puzzle you only need to place tents and dots. While creating a puzzle to place trees, use Shape -> Special 1 -> Trees (3rd Option)

Thank you very much. I am glad you find it useful.

swaroopg92 commented 3 years ago

@nmay231 One of the users (RSP) in the discord server provided this analysis/information that might help. Since you are doing most of puzz.link parsing, thought to share it here:

unnumbered
lits
norinori

numbered
aqre
shimaguni
stostone
heyawake
ayeheya
country
yajilin-regions*
maxiloop*
detour*
nagenawa*
factors*
juosan*
* renders differently

almost works: toichika. arrows dont render

used url p?[id]/10/10/5k88hh20i142e2c5880g3o03vs0001fs02030g123g4g5 

then we have another group of multiple numbers in a region. they work the same minus how they parse ? and illegal numbers
armyants
nanro
cojun
renban
meander
bonsan*
heyabon*
satogaeri*
* renders differently

(doesnt quite work)
usoone - works if no illegal numbers (5+)
hanaregumi - works, but creates illegal clues
putteria - works, but creates illegal clues. renders ? as x
makaro - numbers all become +1

used url p?[id]/10/10/5k88hh20i142e2c5880g3o03vs0001fs02030g1k4k23r5l6o7zi.zp 
there's also aquarium, kinkonkan, paintarea and sukuroroom (and probably more that i accidentally lost) that just do whatever they want basically
nmay231 commented 3 years ago

@swaroopg92 Good to know! I'll use that list when I get back to adding more.

x-sheep commented 2 years ago

Here's some information for conversion of the current genres on pzprxs, and how complex it is to implement:

Exact copies:

Identical encoding, needs different input

Identical encoding, needs rendering tweak

Uses specific encodings

swaroopg92 commented 2 years ago

Thanks @x-sheep that's great information and will help in accelerating the development. We will surely reach out to you if any questions. @nmay231 Sorry just tagging you, to make sure you are aware of this information :)

nmay231 commented 2 years ago

For those who want to support more of the puzzlink puzzles, here are some tips and things to remember:

def puzzlink(tag_name, count = 100): url = (f"https://puzz.link/db/api/pzvs_anon?limit={count}&sort_key=gt.0&order=sort_key.asc&type=in.(%22{tag_name}"

print(len(puzzlink("cave")))



Things that are easy to forget:

- Check how "." in the puzzle URL-string is rendered. Some puzzles render it as a question mark while others leave it blank.
- Update certain files:
  - Include the genre tag(s) of the variant(s) in `docs/js/genre_tags.js`
  - Add tests to `test/public/puzz_link.js`
  - Add urls to `TESTING.md`
  - Update support of the variant(s) in the README.

That said, feel free to ask me or swaroopg92 if you have any questions :)