• About
  • Contact
  • What People Are Saying

Thinking about Go Fish with Python

Mar20th
2012
Leave a Comment Written by Daniel Veazey

FishToday 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.

Be Sociable, Share!
  • Tweet

Related posts:

  1. Introduction to writing card games in Python
  2. Pybrain
  3. Working on the bike problem with Python
  4. Three free books for learning Python
  5. Python, in bitesize chunks
Python    card games, go fish, Python
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
← Introduction to writing card games in Python
Pybrain →

No Comments Yet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Why you should leave a comment

1. I read all the comments.
2. I reply and answer every question.
3. I always click through to see the sites of commentators.
4. Because you can.
5. You become a participant instead of just an observer.

EvoLve theme by Theme4Press  •  Powered by WordPress Daniel Veazey
Things I find interesting