47 Failing Tests on the Wall...
As I guessed last week, after talking with Mike we decided to go with the more robust solution for selecting competitors since the future stories would definitely be implemented. I found plenty of fragility too as implementing the solution broke 47 of my 63 tests. It only took me a few minutes to fix them but there was still a moment of panic as a sea of red failures flowed across my terminal. Most of the failures were a result of the fact that I’d restructured and renamed the method that placed a player’s move, so a quick find-and-replace took care of all but five of them, and then the remaining failures needed to be rewritten anyway.
Still no luck on my white whale, the minimax algorithm. I really thought I’d narrowed it down to how I was ranking the results of each move since I can play all the branches recursively and find out the final value, but unfortunately there’s no consistency in how it takes the best move. It will take a winning move and block a losing move, but I can’t find any correlation to the best move in the data I’m collecting beyond that. I paired with Geoff M at “Code and Coffee” this morning and our solutions were headed down the same road, but he charged me to just test drive the hell out of it from the base case up to the most complex. I’d tried that before but hopefully I’ll have a fresh perspective on it now. The other issue I’ve had is that all of the online resources I’ve found about the Minimax algorithm are fuzzy at best when it comes to completely explaining it and no two code solutions I’ve seen are the same. Once I get mine working I’ll attempt to explain it as clearly as possible.