LoCo Day 20

Today I cleaned up the test cases I created yesterday. I simplified some of the things I was checking for, and as a result most of the tests had common functionality that I was able to pull out into separate top-level functions, which makes the testing code a lot more readable and helps prevent the type checker from going too far down the garden path if there’s a type error somewhere.

That done, I then started implementing some of the actual game-related code. Well, OK, mostly the JSON conversion code, but tomorrow I’ll tackle the real game stuff. The first thing I’ll need to figure out is how to properly generate a starting configuration for a game, making sure players are reasonably spaced out. I don’t know offhand what the generally accepted algorithms are for that, but I bet I’ll be able to find out after a brief bit of searching.

Comments Off