Backtracking to solve simple puzzles
3 March 2008I guess you have probably come across some of these games on internet. They are flashy and stuff. I personally like the puzzles, don’t ask me why. I hate people that keeps asking me what is so funny in playing turn-based RPGs, for example. And I like puzzles even more, so be careful what you say!
So how do those puzzle thingies look-like? This is the simplest I could find:
Niiiice!!
Then you do the magic… one or 2 clicks here and there and… flashy!!!
Wooow!!
Amazing, isn’t it? You better go play and forget about the rest of this post.
Are you serious?
Of course not… c’mon, did you check the domain name of those guys? hacker.org… yeah, right. The game gets boring in 10 levels. But if you really want to take full profit of the rest of this article, have a look at it.
So what it’s in the rest of the article?
Well, the rest of the article consists in how to cheat the game :D. If you had had a look at the game, you would have noticed this:
![]()
Damn… The first is on level 342213443… I wannabe a hacker too…
Wanna be a hacker? Install git on your machine (a compiler might help too!). Clone a copy of my mortalcoil-solver from github. The implementation is simple backtracking: my ibook does quite well to solve it in less than a sec. I didn’t bother to do Branch and Bound. A simple parser gets the input. Nice.
Whatever… how does that thing work?
It’s as simple as this:
Uoooo… The matrix.
Decrypting the output is left as an exercice to the reader. ;)
PS: If someone wants invites to github I’ve got 3 of them that will be given in a FCFS basis.
PSS: Oh, yeah. I know this makes more sense in Haskell. But I was feeling like struggling a bit with the good old C.
PSSS: If you were looking for real programming content… then go check the code!.
Leave a Reply
You must be logged in to post a comment.
One Response to “Backtracking to solve simple puzzles”
June 12th, 2008 at 6:34 pm
Hey! Are you still alive? When will you update your blog!?
Bye…