Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is solving puzzles exciting? People solve crosswords for fun.

Not every programming task is exciting, but some can be fun.



As an example: I was playing Myst, uh, IV? And there was this puzzle that required me to find a short-enough path from one kind of a spot to a different kind of a spot (you had to pick up a soap bubble with a spoon and carry it somewhere, but it would evaporate if you carried it for too long; anyway, the details don't matter).

I was making a map of the level on a piece of paper, and bungled it up (the rooms that were supposed to be adjacent appeared on two completely opposite sides of the paper or something like that). The obvious next step was to write a Python script to take a description of the map (room X: exit north leads to room Y, exit south leads to room Z, etc.) and produce a map (in ASCII art; I didn't want to spend too much time on superfluous graphics).

It was more exciting to write that script and see the map it generated than it was to play the game itself.

I may be weird.


It's not weird at all, at least to me. I still love my solution for a crazy puzzle in Riven (Myst II). You had to select certain stones with animals carved on them. You figured out which ones to select by finding certain objects on the island, and the current screen supposedly contained a shape similar to the object. However it was nearly impossible to figure out which shapes corresponded to which stones partly because the puzzle was spread all over the game, and partly because it was hard to figure out which creature a shape represented. My solution was to use my computer and programming knowledge.

Stage 1 was taking screenshots of the stones and shapes. Stage 2 was outlining the shape screenshots with Paint, and using a simple script to look for the outline color, and other colors would change a background color, so I was left with a simple outline. Stage 3 was using an image display program I created and will be selling soon to create a grid with the shape outlines in the top row and the stones with animals in the other rows. Thus I had all the information needed to figure out the code on a single screen. This was so much more fun than doing it the normal way :)

Oh, and then there was the time I solved the last puzzle in Professor Layton, a sliding block puzzle, by programming it in. I used brute force, which of course didn't work (too slow), but then used memoization techniques and such to speed it up. I not only found a solution, but I found interesting stats, such as the minimum number of moves required. It was even more interesting because it was my first program in Python, so I used it to learn the language. Programming to solve video game puzzles is one of the most fun kinds of programming out there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: