Hi Thomas
Nice job with this! I just won a round on level 2. I'm glad you've
found Python as useful as I have. One suggestion though. I've noticed
you document your Python methods like this:
#Function: dealer_draw().
#Description: Draws a new card for the dealer.

Most Python programmers document their code with a DocString.  For example:

def buildConnectionString(params):
    """Build a connection string from a dictionary of parameters.

    Returns string."""

Triple-quotes allow more than one line, if you simply want one line,
use one quote (like any string). There are a few reasons why you may
want to use DocStrings. First off, you can access it by using the
.__doc__ property. For example: buildConnectionString.__doc__.
Here is a more useful example:
from pydoc import help
help(buildConnectionString)
Help on function buildConnectionString in module __main__:

buildConnectionString(params)
    Build a connection string from a dictionary of parameters.

    Returns string.

While it probably isn't worth the time to change your code to use
DocStrings, it might be useful to know in the future, especially if
people are looking to learn from it.
Thanks.
-Ryan



On Wed, Nov 24, 2010 at 6:27 PM, Thomas Ward <thomasward1...@gmail.com> wrote:
> Hi Charles,
>
> Well, you don't need to know Python to play the game of course, but
> some background would be helpful in understanding the game's source
> code. For example, reading the Python 2.7 tutorial that ships with the
> Python interpreter will give you the language basics such as
> variables, comments, functions, lists, etc. After reading that and
> looking at the source code you can get an idea of how a very basic
> game is pulled together from what you have learned.
>
> To play it just press enter on blackjack.pyc, and it should startup
> and let you play. That is assuming you have Python 2.6 or Python 2.7
> installed of course.
>
> Cheers
>
> On 11/24/10, Charles Rivard <woofer...@sbcglobal.net> wrote:
>> Do we need to know anything about Python?  I don't, yet.  Also, how can we
>> use this free game to see and, maybe, learn a bit about , Python
>> programming?  Thanks.
>>
>> ---
>> Shepherds are the best beasts!
>
> ---
> Gamers mailing list __ Gamers@audyssey.org
> If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
> You can make changes or update your subscription via the web, at
> http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
> All messages are archived and can be searched and read at
> http://www.mail-archive.com/gam...@audyssey.org.
> If you have any questions or concerns regarding the management of the list,
> please send E-mail to gamers-ow...@audyssey.org.
>

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gam...@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to