Comfortably Dumb

Typical blog fare for family, work, gadgets, music, and games.

PuzzleSolver

Scan0002

Those of you that know me, also know that I keep this program called PuzzleSolver up to date on the latest technology. This forces me to learn the new technology and gives me a benchmark application to test the raw performance of the latest platform. You may recall that the last version of PuzzleSolver contained a Java client, a WinForm/CAB client, an ASMX endpoint, a WCF (Indigo at the time) endpoint, a WSE 3.0 endpoint, a Remoting endpoint, and a J2EE endpoint.

 PuzzleSolver

I was able to prove I could use the same service and expose it through any type of endpoint on the Microsoft stack without changing any code. Moreover, I proved I could invoke a Java endpoint with the same code that invoked my Microsoft endpoint. I also had a Java client that demonstrated the reverse scenario.

After that I started my WPF version of PuzzleSolver back in the first half of 2005 when it was still called Avalon.

PuzzleSolverAvalon

It was very rough, but it worked. I’ve finally completed the pure WPF version. It doesn’t consume services and doesn’t use Acropolis. While previous versions were developed and executed on a dual processor workstation and the solving engine ran on a separate thread from the UI it was still a single threaded engine. With the emergence of dual cores and quad cores, I decided to make this version completely multi-threaded.

PuzzleSolver-Blocks-FirstBoard

By taking advantage of generics and few algorithmic modifications I got the solution time down to ~2.25 seconds on dual core 2.1 Ghz HP laptop. By refactoring to take advantage of the ThreadPool the solution time has come down to ~1.8 seconds on the same machine. That is a pretty significant increase in performance. I can’t wait until I get back home to run it on my overclocked quad core and see what the numbers look like. I still have the dual processor workstation, so I’d like to see how much time comes off the 23 seconds solution time the CAB version posted.

PuzzleSolver-Blocks-LastBoard

You may notice that I’ve added tabs. They are still a work in progress and are currently disabled. The Pegs tab will solve the game at Crackerbarrel where there pegs are on a triangle board and one peg is missing and you objective is to remove pegs by jumping over them and have the last peg end up in the hole that was originally empty. I’m considering doing this one in 3D. The ThoughtWorks tab is for my personal enjoyment. I submitted a resume to ThoughtWorks back in 2003 and they sent me a logic puzzle and I was supposed to write a program to solve it. I turned the program around in two days and they never called me back. I guess they thought I cheated or something.

Published Thursday, August 23, 2007 10:20 AM by Chris
Filed under:

Comments

# re: PuzzleSolver@ Tuesday, August 28, 2007 9:07 PM

Hey Chris - I've just stumbled across your blog, and read that ThoughtWorks never contacted you back. That's extremely unfortunate... our policy is *never* to drop an interview in the middle of the application process without notification. Most likely, your code submission got lost somewhere, and the Recruiting department assumed you had given up (which happens quite frequently).

Anyway, apologies for the dropped application, and if you're still interested in consulting, I encourage you to apply again!

by TWer

# re: PuzzleSolver@ Wednesday, August 29, 2007 3:09 PM

I was notified that you were not going to move forward. My intention was to convey that I didn't get a callback for the next round of interviews. Consulting is all that I have ever done and probably all that I will ever do. My role at Microsoft allows me to focus on enterprise customers adopting SOA concepts.

by Chris

Leave a Comment

(required) 
(required) 
(optional)
(required)