joshbduncan / word-search-generator

Make awesome Word Search puzzles!
MIT License
74 stars 24 forks source link

Copypasteable Masked output #78

Closed JeroenSteen closed 4 weeks ago

JeroenSteen commented 1 month ago

I tried running a masked output of a hearth, and it shows correct in the terminal. But when I copypaste it, and inspect the output in Sublime Editor. It's missing some extra spaces to say, so that it would be easier to design the word search puzzle for example in Adobe Indesign. Can the output be padded with spaces also on the right side of each row?

So like this:

    J I P       B F M    
  W B D C J   Q G Z Y X  
H N H I D O B I D D E N J
Y M Z N J J X E J O Z E F
E G K Q H B E M A R I A S
  Z E R R G E Z T M G P  
  Q N L U Q N L U C A  
    H M O I S T E S D    
      F S O S U E G      
        P O F L G        
        A Y K W        
          A C G          
            Y            

Instead of something like this:

    J I P       B F M
  W B D C J   Q G Z Y X
H N H I D O B I D D E N J
Y M Z N J J X E J O Z E F
E G K Q H B E M A R I A S
  Z E R R G E Z T M G P
  Q N L U Q N L U C A
    H M O I S T E S D
      F S O S U E G
        P O F L G
        A Y K W
          A C G
            Y
joshbduncan commented 1 month ago

So, two things...

  1. The output is padded on the right to the extent of the mask. If you write the output to a text file like below and open in Sublime, you should see the spaces.
$ word-search -r 10 -m Heart > puzzle.txt

Here is a screenshot of the text file in VS Code. The spaces on the right are visible.

CleanShot 2024-10-21 at 07 21 40@2x

If you are on a Mac, you can also use the pbcopy command to skip the text file creation part...

$ word-search -r 10 -m Heart | pbcopy

Now the output will be on your clipboard to paste right into Indesign.

  1. When pasting the output, the padding on the right really shouldn't effect the output as long as you use a fixed-width font. I don't have Indesign installed on my system currently, but here is a screenshot from Illustrator showing the before-and-after of using a fixed-width font.

CleanShot 2024-10-21 at 07 27 38@2x

Let me know if this clears things up for you. Thanks for checking out the package!