[Tutor] New programmer, need some help getting started on my first project

Chris Delgado prowlerslim at yahoo.com
Wed May 17 03:09:30 CEST 2006


Alan, 

First off, thanks for the detailed reply, it is much appreciated. On to your message:

>I don't know anything about poker but in general terms this is
>a text format conversion tool. since you know the source can
>be in different formats I'd adopt an OOP approach with a generic
>hand object which can be subclassed for each new format.
>The methods of the hand object might be something like load()
>and print(). The load method will be specific to each site and
>will convert the site format to some standard format defined
>in the generic hand. The print method then prints to a standard
>output format and only needs overriding for sites where you
>need a different output format - which sounds to be rare from
>your desciption.

>The generic hand class then allows you to write the resty
>of the application in a generic way without worrying about
>site details apart from the point where you instantiate the
>hands - and even that can be data driven via an external file
>or environment variable etc..

Well, I thought this would be the right approach to take given where I ultimately want to go with this. Im glad that I was thinking about this in the correct fashion. 

>Possibly but I would defer that decision for as long as possible!

Hmm can you elaborate on this? (re: regular expressions) 

>You may need a pot class in the same way as the hand
>above - but I'm not sure how that would workj since I don't
>know anything about poker!

Quickly on the format of the form of poker that I play most: No Limit Texas Hold'em

Each player is dealt 2 cards face down. There are 2 forced bets called the Small Blind and Big Blind. Each player, starting to the left of the blinds can fold, call, or raise any amount. Once the action is complete, 3 cards are dealt face up(these are community cards, and are used in conjunction with the players' hole cards to make their best hand), and the betting action repeats itself, only now the Small Blind acts first. Another card is dealt face up if there 2 or more players left and the betting action occurs again. Once the action is complete then a final card is dealt and the action repeats. The remaining players then showdown their hands and the best 5 card hand wins. So a pot class would have to be able to extract the dollar amounts from each round of betting and then sum them after each betting round. This is important for talking about how hands play out, but I wont talk about why unless you are just interested. 

>It would be more helpful - to you and the rest of the
>readership - if you keep it public. The kind of questions you
>will be asking are likely to be the kind any newbie will come
>across in a real project. By sharing the pain you also share
>the experience. You also get access to many more heads.

Thank you. I hoped to discuss it via the list but didnt want to spam the list unnecessarily. 

>Converting the Perl into Python shouldn't be too hard when
>we get to the stage of needing to do that. For now let's start
>with one site and get it working, while building in enough
>flexibility for the future sites we know we need to deal with later.

I just wanted to let you know that I had one in case anyone was interested in working version. Here is an interesting thing. All the converters that I know of are not stand alone apps. They are tied to forms on websites where people input their hands and then take the output to post on various popular internet poker web forums. I can provide links if anyone is interested. I wasnt necesarily wanting to convert the script, that feels a bit like cheating. 

>In fact maybe we should start at the end and work on the
>internal data structure needed to print out the final format.
>Can we define a program that can read the target format
>in and print oit out in the desired format? It may sound trivial
>but it gets a lot of the scaffolding in place early.


I was very very happy to read this Alan. I was going to ask you in my original email if I should start with the output and work backwards. It actually gives me a lot of confidence that I seem to be thinking along the right lines here. I will start working on that and provide the list with my work on that. Thanks again Alan.


Cheers, 
Chris

		
---------------------------------
Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060516/8a2e50d2/attachment.htm 


More information about the Tutor mailing list