Giter Club home page Giter Club logo

Comments (9)

joshbduncan avatar joshbduncan commented on June 20, 2024 1

I understand. I'll let you know when I get an updated version uploaded. Thanks!

from word-search-generator.

joshbduncan avatar joshbduncan commented on June 20, 2024 1

I've got a working PR #16 that I think provides the functionality you are looking for.

You can call the save() method with solution=True to have the solution exported within the same file as the puzzle.

p = WordSearch("dog cat pig")
p.save("test.pdf", solution=True)

...result in the pdf file linked below. The "solution" is added as a second page with the words highlighted in red just as you get with the show(solution=True) method.
TestWithSolution.pdf

p = WordSearch("dog cat pig")
p.save("test.csv", solution=True)

...result in the csv file linked below. The "solution" is added at the bottom of the csv file with only the puzzle words visible. All other characters are represented as a blank space " ".
TestWithSolution.csv

Have a look and let me know what you think. Thanks!

from word-search-generator.

joshbduncan avatar joshbduncan commented on June 20, 2024 1

Yeah, I haven't merged the new feature code and released a new version yet... So if you installed it using pip you would get that error. I just wanted to get your feedback on the attached pdf to see if that is the result you were looking for before I released the new version.

from word-search-generator.

joshbduncan avatar joshbduncan commented on June 20, 2024

There is no current functionality to save the puzzle solution to PDF. I assume by "solution", you mean what gets output when calling puzzle.solution? If so, It wouldn't be very hard to add it's just not there now. The answer key is printed at the bottom (and upside down) of the standard puzzle PDF output.

Am I correctly understanding what you are asking?

from word-search-generator.

joshbduncan avatar joshbduncan commented on June 20, 2024

So, I thought of 3 potential solutions. Let me know if any sound better or worse to you.

puzzle.save("filepath.pdf", solution=True)
  1. The command above saves the standard PDF puzzle file but highlights the solution by either coloring them in red or putting red squares around them.
  2. The command above saves the standard PDF puzzle file and includes a second page with the solution. The second page would be the same as the first but would only show the letters from the puzzle words.
  3. The setting above would only save a PDF file of the solution at the specified path. This option would require you to save the standard puzzle output in a second step.

from word-search-generator.

ALEXDINO7 avatar ALEXDINO7 commented on June 20, 2024

sorry for my English I think the first and second answers are better, my point is to get the answer on a separate page

in the last, after I run the script I hope to get

page 1 contains the word search puzzle
page 2 get the solution of the puzzle on (pdf or image)

I hope you understand me and thanks for this repo

from word-search-generator.

ALEXDINO7 avatar ALEXDINO7 commented on June 20, 2024

I understand. I'll let you know when I get an updated version uploaded. Thanks!

thanks for help

from word-search-generator.

ALEXDINO7 avatar ALEXDINO7 commented on June 20, 2024

I've got a working PR #16 that I think provides the functionality you are looking for.

You can call the save() method with solution=True to have the solution exported within the same file as the puzzle.

p = WordSearch("dog cat pig")
p.save("test.pdf", solution=True)

...result in the pdf file linked below. The "solution" is added as a second page with the words highlighted in red just as you get with the show(solution=True) method. TestWithSolution.pdf

p = WordSearch("dog cat pig")
p.save("test.csv", solution=True)

...result in the csv file linked below. The "solution" is added at the bottom of the csv file with only the puzzle words visible. All other characters are represented as a blank space " ". TestWithSolution.csv

Have a look and let me know what you think. Thanks!
thanks for the update
still not working I use the code
p = WordSearch("dog cat pig")
p.save("test.csv", solution=True)

" TypeError: WordSearch.save() got an unexpected keyword argument 'solution' "

from word-search-generator.

ALEXDINO7 avatar ALEXDINO7 commented on June 20, 2024

Yeah, I haven't merged the new feature code and released a new version yet... So if you installed it using pip you would get that error. I just wanted to get your feedback on the attached pdf to see if that is the result you were looking for before I released the new version.

it's perfect you can add a grid system (border on each letter) it will be better Other than that everything is great

from word-search-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.