Learn to Program with Python 3: A Step-by-Step Guide to Programming by Irv Kalb
Author:Irv Kalb [Irv Kalb]
Language: eng
Format: epub
Publisher: Apress
Published: 2018-09-25T00:00:00+00:00
Playing a Game Multiple Times
In most computer games, when one round of the game is over, you get the option to play again. In the output at the beginning of this chapter, I showed this option for our Guess the Number game. On a conceptual level, playing a game multiple times can be thought of as each round of the game in a loop. That is, we can build an outer loop to play multiple games, and an inner loop that plays a round within each game.
There are two possible implementations. If the game is simple enough, you can build a loop within a loop. Here is the pseudocode:#
Playing multiple games loop
Play multiple rounds of the current game
Play a round or move within a game
Ask if the user wants to play again, if not, exit
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(11914)
Hello! Python by Anthony Briggs(9379)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9348)
The Mikado Method by Ola Ellnestam Daniel Brolund(9316)
Dependency Injection in .NET by Mark Seemann(8864)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7857)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7336)
Grails in Action by Glen Smith Peter Ledbrook(7303)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7123)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5964)
Kotlin in Action by Dmitry Jemerov(4653)
Practical Vim (for Kathryn Amaral) by Drew Neil(3729)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(3599)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3431)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3250)
Learning Java by Patrick Niemeyer & Daniel Leuck(2872)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2842)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(2752)
Mastering Java 9 by Dr. Edward Lavieri(2574)