Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Perl Example of Control Break Processing

by ww (Archbishop)
on Sep 10, 2011 at 10:45 UTC ( [id://925232]=note: print w/replies, xml ) Need Help??


in reply to Perl Example of Control Break Processing

OK; most of us don't spend our time programing Five-card stud|draw... and your program lacks verisimilitude, in that (for example) Ted might reasonably fold after the first or second round of betting in Round 2...

BUT, more important, your program includes no code specific to what you intended to demonstrate (or if it does, I'm misreading "Control Break" and should crawl back in my hole and shutup; 'shaddup!', that is, except for offering the notion that if the illustration is there, you may want to highlight it in the code, and accompany that with explanatory narrative.

That said, however, the existing code is clear and reasonably short (but remember, publishers -- in effect -- pay by the line for that which they print, so you'll be dealing with an editor with a bias toward VERY short code samples.

  • Comment on Re: Perl Example of Control Break Processing

Replies are listed 'Best First'.
Re^2: Perl Example of Control Break Processing
by Jim (Curate) on Sep 10, 2011 at 15:14 UTC
    [Y]our program includes no code specific to what you intended to demonstrate …, that is, except for offering the notion that if the illustration is there, you may want to highlight it in the code, and accompany that with explanatory narrative.

    Good suggestion. Yes, Damian Conway would have highlighted the two control breaks in the example code and then elaborated on them in the text.

    The two control breaks are the two if-then constructs. The first one occurs when the dealer has dealt the fifth card to the player to his right. The second one—the terminal one—occurs after the nth round of play.

    I suppose one could argue there's a third control break in the program that occurs when the deck of cards is exhausted and reshuffled. It's implicit in the loop construct, so its implementation is different than the other two control breaks. But I realized after I wrote the script that poker isn't played this way. The deck is reassembled and shuffled after each hand.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://925232]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-23 15:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found