public

Solve a hard Sudoku problem using R

  • Download Gist
Solve a hard Sudoku problem using R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# -----------------------------
# SUDOKU
# -----------------------------
# Solve a Sudoku problem in seconds
 
# create a text file under c:\ drive called "hard sudoku problem.txt" with following text (without # symbol) and then run the code below
#85---24--
#72------9
#--4------
#---1-7--2
#3-5---9--
#-4-------
#----8--7-
#-17------
#----36-4-
 
install.packaged("sudoku")
library(sudoku)
s <- readSudoku("c:/hard sudoku problem.txt")
s
solveSudoku(s)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.