On Monday Java and I made our peace and it’s been a productive start to the week. I finished up my tic-tac-toe implementation yesterday with some surprising results.

My minimax algorithm in Java is almost identical to the one I did in Ruby, except that I haven’t done any alpha-beta pruning or depth optimization yet. The surprise is that my tests for a correct move on an open board are executing in under a second, whereas the Rspec tests for an unoptimized version in Ruby took over three minutes! This is such a huge difference I immediately assume something is wrong with my code… but I’m testing all the cases I need to and they keep coming up green, quickly. However, I can’t actually play the game until I wire up my server…

Which brings me back to the echo. I’ve been reading up on HTTP servers and looking through the craftsmen’s various implementations, but like many problems I was hesitating on that first step. Mike gave me the challenge this morning of starting with an Echo server, which is a server that just repeats back whatever the client sends it.

Using both the Princeton online example and Mike’s echo example I was a able to spike through this and by the end of the day had an echo server and echo client running in my IDE. I was actually a little surprised it went through on the first try, but like I said, apparently Java and I made our peace.

Tomorrow, on to test driving an actual server.