Sudoku _erlang Problem Solving code

Source: Internet
Author: User

A few days ago LP play Sudoku, play to master a variety of abused, I looked to say, minutes to help you do it out,

The result is of course not done.

So the internet search the next Sudoku code, read the next C code, mostly recursion and the like (such as http://blog.sina.com.cn/s/blog_9e16dc4d01013s1y.html)

So think, can this approach be implemented in Erlang?

Tried, found no, because 2-dimensional arrays, pointers what is not in Erlang completely, and the variable, all to change the idea, since Erlang can be concurrent, then the concurrent to fill

Sd_one is to use the unique fill method and the implicit unique Fill method (basic exclusion method) to fix the number set to fill in, if Sd_one, run complete (all the optional values are not changed), use sd_guess to guess the rest of the fill, guess the main process to send an OK message

As for the variable can not change the problem, at first I want to use ETS, the results found that there is not much data, process dictionary faster, and then everything is seconds seconds out

And then try the Baidu inside called the very difficult Sudoku

O (^▽^) o, easy to extract ~ ~ ~

Sudoku _erlang Problem Solving code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.