Skip to content

Generate virtually unlimited amounts of braille sudoku puzzles in BRF and PEF format!

License

Notifications You must be signed in to change notification settings

LPBeaulieu/Braille-Sudoku-Brailloku

Repository files navigation

Brailloku

Generate virtually unlimited amounts of braille sudoku puzzles in Braille Ready Format (BRF) and Portable Embosser Format (PEF)!

Image Brailloku Braille BRF and PEF Sudoku Generator

Brailloku

License: AGPL-3.0 GitHub last commit GitHub issues Linux macOS Windows


Brailloku is an app that generates virtually unlimited amounts of braille sudoku puzzles in Braille Ready Format (BRF) and Portable Embosser Format (PEF)!

You can also select the number of empty cells in your puzzle (up to 49 inclusively) and the number of puzzles that you want it to create for you!

Image Brailloku In Action


Figure 1: The image above shows how you could play directly on embossed sudoku puzzles, with the help of braille-labelled magnetic push pins. I recommend laying a placemat over the metallic magnetic board in order to decrease the strength of the neodymium-based magnets, which could otherwise crush the braille dots. Also, the base diameter of the magnets should be at most 15 mm (or 0.6 in) in order to properly fit within the cells of the embossed sudoku grid. As I don't have access to a braille embosser, I typed my sudoku on my Perkins Brailler, but it should print very nicely in portrait mode on 8 1/2 by 11" braille or cardstock paper.

📝 Table of Contents

⛓️ Dependencies / Limitations

  • The sudoku puzzles generated by Brailloku are created such that there is always a way to fill an empty cell by direct logical deductions, without resorting to pencil marks or complicated tactics. This is an important factor for sudoku puzzles in braille format, as the player cannot annotate the sudoku grid with pencil marks and moreover doesn't have a broad view of the playing grid, which is required for more complex puzzle solving techniques.
  • The point described above entails that there is a limit to the number of empty sudoku cells that can be included in any given sudoku puzzle while meeting these requirements. As such, a maximum of 49 empty sudoku cells can be selected by the player, and the time required to generate a puzzle with 49 empty cells can exceed 5 seconds.
  • Each BRF and PEF document consists of two pages (a sudoku puzzle and its solution on the next page), both of which take up to a maximum of 30 columns per line and span 22 lines per page. These settings will help you set up the embosser so that you will obtain optimal results when embossing the files on 8 1/2 by 11" braille paper or cardstock in portrait mode.
  • You can also opt for a truncated version of the sudoku grid (excluding some of the header text, bringing the number of lines down to 20 lines per page, which allows for embossing on A4 paper in landscape mode without margins.

🏁 Getting Started

The following instructions will be provided in great detail, as they are intended for a broad audience and will allow to run a copy of Brailloku on a local computer. Here is a link to an instructional video explaining the steps described below: https://www.youtube.com/watch?v=mfBk78S8VXU.

The steps below are given for Linux operating system (OS) environments, as I work with Linux on my computer, but the code should run fine on other operating systems (windows, macOS) as well. Please send me an e-mail to the address below should you encounter any issues and I will try to further improve my code.

Step 1- Head over to the main Brailloku github page, click on the Code button and then click on the Download zip button. Extract the zipped folder into your desired location, and the "Braille-Sudoku-Brailloku-main" folder will now serve as your working folder, which contains the Python code you will later run in order to generate sudoku puzzles.

Download Code Screenshot


Figure 2:The image above shows the steps to take in order to download the compressed folder containing the code.

Step 2- In order to set up Brailloku on your computer, access your working folder in the file explorer, and click on the folder’s arrow in the window’s header. Then, simply click on "open in terminal" in order to open a windowed command line, with a correct path to your working folder, as shown in Figure 3.

Open in Terminal Screenshot


Figure 3: The image above shows the steps to take in order to open the command line in your working folder.

Copy and paste (or write down) the following in the command line to install alive-Progress (Python module for a progress bar displayed in command line):

pip install alive-progress

Step 3- You're now ready to use Brailloku! 🎉

🎈 Usage

To run the "brailloku.py" code, open a windowed command line in your working folder as shown in Figure 3 and enter the following:

python3 brailloku.py

Brailloku by default generates sudoku puzzles with a number of empty cells between 26 and 49, inclusively. You can also manually select the number of empty sudoku cells in the puzzle (up to a maximum of 49, inclusively) by typing "e" for empty cells, followed by the desired number. For example, should you like to have 35 empty cells in your sudoku puzzle, you would enter the following in command line:

python3 brailloku.py e35

Furthermore, you can have Brailloku generate multiple braille sudoku files (each containing one sudoku and its solution on the following page) which are numbered for easy reference, by typing "n" for number of puzzles, followed by the desired number. Please note that in some cases, a puzzle can take more than 5 seconds to generate, as there is a lot of computation being done to ensure that the puzzle will be solvable without resorting to pencil marks or complex tactics. For example, should you like to generate 50 sudoku puzzles, you would enter the following in command line:

python3 brailloku.py n50

You can also specify both the difficulty level and the number of puzzles to generate. Simply enter both arguments mentioned above in any order, after the Python code call. Please make sure to include a space in-between the Python code file name and any additional arguments. For example, to generate 50 sudoku puzzles each having 35 empty cells, you would enter the following in command line:

python3 brailloku.py n50 e35

Finally, you can also opt for a truncated version of the sudoku grid (excluding some of the header text), bringing the number of lines per page down to 20 lines), which allows for embossing on A4 paper in landscape mode without borders. You would then need to enter "short" as an additional argument after the Python call. For example, to generate 50 truncated sudoku puzzles each having 35 empty cells, you would enter the following in command line. As always, the order of the arguments after the Python code file name doesn't matter):

python3 brailloku.py e35 n50 short

Brailloku automatically creates a folder named "Brailloku Sudoku Puzzles" within your working folder. It then generates the "Braille Ready Format (BRF)" and "Portable Embosser Format (PEF)" subfolders within the "Brailloku Sudoku Puzzles" folder, and stores the files there. It also uses the file numbers of the BRF or PEF files in the "Brailloku Sudoku Puzzles" subfolders in order to assign the new sudoku puzzle numbers, so it is important to leave the files in those folders and to avoid renaming them to ensure that the numbering remains accurate later on.


And that's it! You're now ready to solve as many braille sudoku puzzles as you like! If you are close to someone who is visually impaired and would like to help them find an accessible version of sudoku, or maybe if you are only sprucing up your braille reading skills in preparation for the Zombie Apocalypse (lol) then this app is for you! 🎉📖

✍️ Authors

  • 👋 Hi, I’m Louis-Philippe!
  • 👀 I’m interested in natural language processing (NLP) and anything to do with words, really! 📝
  • 🌱 I’m currently reading about deep learning (and reviewing the underlying math involved in coding such applications 🧮😕)
  • 📫 How to reach me: By e-mail! LPBeaulieu@gmail.com 💻

🎉 Acknowledgments

  • Hat tip to @kylelobo for the GitHub README template!