With all the hand-ranking functions complete (see last week’s Lesson), the final version of my poker program restores the randomizer, draws and sorts a hand, then outputs the hand’s value. It’s quite disappointing.
Continue reading
Author Archives: dgookin
The Yorn Function
When a computer program wants to know a Yes or No answer, the function I write is called yorn().
Continue reading
One or Two Pairs (Poker VIII)
Matching two card values in a poker hand counts as a pair. It’s the lowest-ranking hand (above the non-ranked “high card”) and the most common. In my poker program, it’s also the last ranking hand tested.
Continue reading
Four-of-a-Kind, Three-of-a-kind, and a Full House (Poker VII)
To effectively evaluate poker hands, the next sequence after a straight, straight flush, and flush draw (covered in last week’s Lesson) is to evaluate four-of-a-kind, then three-of-a-kind, and (while you’re at it) a full house.
Continue reading
Flush, Straight, and Straight Flush Tests (Poker VI)
After pulling out any hands arranged in a straight pattern, covered in last week’s Lesson, the next logical test is for a flush. The flush draw is when all cards are of the same suit.
Continue reading
Know Your GPA – Solution
It’s fun supplying your own scores for a semester, which really helps boost your GPA! Still, the challenge for this Month’s Exercise was to input — and validate — a series of grades to calculate your GPA for five courses.
Continue reading
Straight Draw (Poker V)
The first test for a hand of five cards is the straight, specifically an Ace-high straight followed by a standard straight. To perform this test, I’ve concocted a special version of the program, one that has a set of pre-drawn poker hands.
Continue reading
Know Your GPA
This semester has been brutal! You’ve had five classes, three of which are required for your major and two electives that turned out to be tougher than you anticipated. Yet, you pulled through the term without dropping a single course. You now have your grades and want to know your GPA for the semester.
Continue reading
Evaluating Poker Hands (Poker IV)
Last week’s Lesson brought the Poker program up to speed with regards to drawing a hand of 5 cards. The playing_card structure provides a convenient reference for each card, and the hand is sorted. Now comes the fun part: Determining the hand’s value.
Continue reading
Drawing A Hand of Cards (Poker III)
Improving upon last week’s Lesson, this update to the playing card simulator offers one minor change: Multiple cards are pulled from the draw() function.
Continue reading