Today I’m thinking about the Go Fish program I want to write in Python. Writing code that follows the rules of the game seems fairly straightforward. But there are a few advances I’d like to make with this program from my last program that made the computer play War against itself.
First, I want to make it where a human player is playing against the computer. Sure, watching a computer play against itself is neat for a few seconds, but it gets boring if there is no interaction. Achieving this shouldn’t be too hard. I should be able to make it print a menu of all the cards in your hand, then you just choose the corresponding menu item for the card you want to ask your opponent for.
Second, I will have to make the computer adhere to a strategy. Instead of just playing the top card from its hand, like it does in War, the computer also will have to choose what to ask for from you. Maybe I could write it so it just goes through its list of cards and asks for each consecutive card in its hand. I also want to make it so if the computer draws something you have recently asked for, it will know to ask you for that card. Perhaps I could create a difficulty setting so the harder the opponent, the longer it remembers what cards you’ve asked for.
It seems kind of daunting, but I know that all I have to do is break it down into smaller pieces, and only work on them one at a time.