BookmarkSubscribeRSS Feed

Sudoku Puzzle Generator

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

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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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