Tuesday, January 24, 2017

Diary: Clare's health + debugging 'noughts and crosses'

A quiet day, interrupted by croaking and coughing from the bedroom.

Clare has retired to bed with a heavy cold, shivering under a duvet, a second duvet and a fleece, despite both radiators being on. I tell her she looks like something out of a mediaeval plague scene, perhaps Hieronymus Bosch?

She opens a bleary eye and croaks.

My complementary immune system is functioning just fine. Did weights yesterday - pretty much the whole programme - and today spun the exercise bike for 18 minutes and 14 seconds to burn 200 Calories. That was breakfast.

I have spent most of the day debugging my noughts and crosses program. First the function that builds the game tree didn't work: I had mentally elided the distinction between the tree-building function recursively 'switching sides' as it constructs alternating plies of crosses and noughts down the tree .. vs. the need to continually remember which side the player is actually playing so you can distinguish a win from a loss. You need two parameters, not one.

Silly that.

Now the minimax function, which traverses that tree and bubbles terminal scores to the top (alternating between propagating minimum and maximum subtree values) is playing up - but only some of the time.

Both these functions are deeply recursive and quite general to any tree-search program. At this point the bugs are subtle .. and I have given up for the day.

I hope to dump the working code here one of these days. It's harder (when you do generalised tree-search) than one might initially think.

No comments:

Post a Comment

Comments are moderated. Keep it polite and no gratuitous links to your business website - we're not a billboard here.