Step Away From the Screen
I spent the entire day yesterday working on the Minimax algorithm and made a lot of progress. There were a couple of things that contributed:
1) At Mike’s suggestion I spent some time at the whiteboard… and I used a lot of it. I pretty much just wrote out my two main methods and the act of hand-writing them really helped to unravel the knots I’d tied up inside my head. It also helped me discover both flaws in the code and places that I could tighten it up.
2) The white board is by the big windows, hammock and treadmill desk, so whenever anyone needs to take a break from their screen they often wander up to this area. Mark, Ben and Cymen, three resident apprentices, wandered up there while I was writing on the board and I was able to chat with them a little about what I was trying to do and where I was getting stuck. It’s amazing how differently the brain processes things when it’s verbal and talking to these guys definitely helped me see the problem from a different perspective. Mark also suggested that I use a 2x2 grid for debugging purposes as long as my methods for the Board class would still work. Fortunately they did so that’s been a huge help.
I think my final hurdle is persistence- and in the code sense, not the tenacious sense. With my recursive method as it is I’m not holding the right branches of the game in memory properly so the possible outcomes that the AI is returning are the result of playing out previously half played games.
Hopefull today I can unravel that final knot.