Forked from prasoonsharma/Solve a hard Sudoku problem using R
Created
July 25, 2014 23:23
-
-
Save rwpr/f5fd970ad8e5fe46b338 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------- | |
# 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) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment