Computer play has begun — and this could take a while
This post is part of ChurrPurr.ai, a challenge to design an online strategy game and the AI to master it. Play the latest version of the game here.
Tonight I am en route to Cambridge, Mass., where I will be attending MIT’s AI and the Future of Work conference. Since I have some time to kill — at least until the World Series game begins in earnest — I figured I’ll update Churr-Purr’s gameplay so that the computer can pass moves directly, rather than telling me what to do on its behalf.
After a little code refactoring, and working out the puzzle of the activation/sliding stage (we want to treat this as one computer step, as it doesn’t make sense to activate a square it won’t then slide), Churr-Purr is updated and ready to begin playing computer moves.
For now, the computer is playing randomly — there’s no evaluation function to determine which is the best action; only selection of a random valid action — but the overall code structure is in place for feeding more-wisely-chosen moves.
And of course, random computer vs. computer play can make for some marathon sessions.
In practice, the computer will play many more simulated moves than the glacial pace I’m setting in the video (one per click, or maybe ~2 per second). Also, the computer won’t forever be moving randomly; over time it will improve its representation of the game to converge upon the right set of moves (such as connecting 3-in-a-rows when available).
Still, it’s good to see where the computer is starting from — and to affirm that there’s nothing innately intelligent about the process of filling in and shifting these squares. Instead, it will be the process by which the computer determines which squares to move, in which we’ll get to the true ‘intelligence’.
Read the previous post. Read the next post.