Work the Shell - Recognizing Blackjacks
We've run out of space for this column, but all that's left is to implement the overall play logic. The game as it stands now shuffles the deck, deals cards for the player and dealer, lets the player add new cards (“hit” in Blackjack parlance) until he or she is satisfied or exceeds 21 points, and shows the dealer hand. Next column, we'll write the loop that lets the dealer play out its hand and determine who won the hand. No doubt we'll sneak in some interface features too, of course, but one way or the other, next column will be a wrap for this particular scripting project.
This means I'll be ready to tackle something new! If you have a particular scripting project you think could be an interesting study, please drop me an e-mail, and I'll consider it for a future column series. Otherwise, I've been eyeing the game Yahtzee pretty closely.
Dave Taylor is a 26-year veteran of UNIX, creator of The Elm Mail System, and most recently author of both the best-selling Wicked Cool Shell Scripts and Teach Yourself Unix in 24 Hours, among his 16 technical books. His main Web site is at www.intuitive.com.
Dave Taylor has been hacking shell scripts for over thirty years. Really. He's the author of the popular "Wicked Cool Shell Scripts" and can be found on Twitter as @DaveTaylor and more generally at www.DaveTaylorOnline.com.
Webinar: 8 Signs You’re Beyond Cron
On Demand NOW
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.View Now!
|Dr Hjkl on the Command Line||May 21, 2015|
|Initializing and Managing Services in Linux: Past, Present and Future||May 20, 2015|
|Goodbye, Pi. Hello, C.H.I.P.||May 18, 2015|
|Enter to Win Archive DVD + Free Backup Solution||May 18, 2015|
|Using Hiera with Puppet||May 14, 2015|
|Urgent Kernel Patch for Ubuntu||May 12, 2015|
- Initializing and Managing Services in Linux: Past, Present and Future
- Dr Hjkl on the Command Line
- Goodbye, Pi. Hello, C.H.I.P.
- Using Hiera with Puppet
- Enter to Win Archive DVD + Free Backup Solution
- Mumblehard--Let's End Its Five-Year Reign
- Gartner Dubs DivvyCloud Cool Cloud Management Vendor
- A More Stable Future for Ubuntu
- Infinite BusyBox with systemd
- It's Easier to Ask Forgiveness...