BookmarkSubscribeRSS Feed

Sudoku Puzzle Generator

Started ‎07-05-2014 by
Modified ‎04-04-2022 by
Views 3,572

The macro generates Sudoku puzzles using a two-stage algorithm.   Initially it finds a completed Sudoku square using a Markov chain algorithm that tries to sample at random from all squares that exist. The macro is not restricted to 9x9 squares and can generate squares up to 25x25 within a reasonable amount of time.  In the field of experimental design, these squares are known as gerechte designs with rectangular regions.  The second stage algorithm uses very simple reverse solving logic to generate a valid puzzle, by removing clues one by one from the completed square.  The puzzle generated is written to a SAS data set in the work library and can also be viewed as listing output or as RTF/PDF files.

Version history
Last update:
‎04-04-2022 03:17 PM
Updated by:

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Labels
Article Tags