Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Tentaizu

Name: Anonymous 2010-12-04 4:33

Can someone explain what the parts of this code do? http://pastebin.com/Tx4e77V7

There are no comments in the code


http://green-oval.net/cgi-board.pl/g/thread/14609694

Here is my thread from /g/ talking about the premise of the program

Name: Anonymous 2010-12-04 11:10

It's a brute-force solver. The basic algorithm goes like this:

1. Let S be the first unknown square. If there are none, then the game has been solved, so record the solution somewhere and return true to indicate a solution was found.
2. If S being a star does not contradict anything already known, set S to a star and recurse to step 1. If this recursion returns true, then return true.
3. If S being a non-star does not contradict anything already known, set S to a non-star and recurse to step 1. If this recursion returns true, then return true.
4. If we reach this step, then the game has no solution because both S being a star and S being a non-star had contradictions. Unset S and return false.

Name: Anonymous 2010-12-04 22:26

>>6
So it just is a DFS of the squares and if goes until there is a fault found and it backs up to a point where there isn't a fault and changes one spot and tries again?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List