Programming Puzzles 392
An anonymous reader writes "Spotted over at the Economist: 'Sliding-block puzzles look easy, but they can be tricky to solve. The best known is the 15 Puzzle, which became hugely
popular in the late 1870s. This involves square tiles labelled with the numbers 1 to 15, which must be arranged in the correct order inside a four-by-four frame.' While we've all tried these puzzles, the inventor of Quzzle set out to design the easiest looking -
yet most difficult puzzle around and turned to CS to find it. While
the original article touches on it, at the puzzle's site you'll find
Jim Lewis, the inventor, wrote a program in Haskell, a functional programming language to find the best design."
high return rate (Score:3, Insightful)
Ideally puzzles offer some form of partial gratification if one can see that they are getting closer. I don't know yet if this puzzle is all-or-nothing. There are a lot of different factors that make a puzzle commercially successful. Driving them crackers with deceiptful design is not aways one of them. But, it is an interesting idea.
Whats so special? (Score:3, Insightful)
The puzzle presented in the article can be solved easily using a variety of basic AI heuristic search algorithms. A* and its varients come to mind.
I fail to see the significance of this guys program when people in my beginners AI class do this stuff for course projects every semester.
Re:Whats so special? (Score:3, Insightful)
Re:I will help YOU get a JOB! (Programming puzzles (Score:3, Insightful)
Computer science has devolved into programming. Is the code that important, or the solution in regular syntax?
I think most people would find this difficult because they forget how to program in these languages, but that doesn't mean they can't see the answer
Re:I will help YOU get a JOB! (Programming puzzles (Score:2, Insightful)
I only did the ones that specifically listed C. Number 3 (and, I suppose, 4 for that matter) is dubious because ^ won't work for all types. And beware of the "better" version: x ^= y ^= x ^= y; That's not defined behavior in C!
Re:Question 3 Solved (Score:3, Insightful)
Re:Question 3 Solved (Score:3, Insightful)
Re:Use only subtraction and addition (Score:3, Insightful)
Maybe the people who start generating code without properly understanding and defining the problem to be solved don't get the job? Who wants a programmer who jumps into code-writing as the first step of design?
Re:the 15-square puzzle (Score:3, Insightful)
For this to work right, you also have to color the squares in a checkerboard pattern, like the old plastic ones I used to have. Then the two R's are the same color, but the two A's are not. So if your victim uses the other A, the puzzle still won't look right