sudoku by rst76

main=interact(\x->foldr(!)[x][0..length x-1]!!0)
i!s=[take i x++a:drop(i+1)x|x<-s,let(%)=mod;j=i%91;k=j%10;f"0"=[a|a<-['1'..'9'],and[a/=drop(i-j+m)x!!n|m<-[0..8],n<-[j-k,k+m*9,j-j%30+k-k%3+div m 3*7]]];f x=x,a<-f[x!!i]]

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page