Captain Code: Unleash Your Coding Superpower with Python

Book description

Becoming a coder is all fun and games!

Everyone should learn to code. Much like drawing and sketching, playing an instrument, cooking, or taking pictures and shooting videos, coding is a creative endeavor, which means it's a way to actually create stuff, and creating stuff is incredibly rewarding and satisfying. Sure, it's fun to spend hours on your phone looking at what other people have created; but that's nothing compared to the joy and satisfaction of creating things that other people consume and use. Yep, coding is fun!

And if that weren't enough, when you learn to code you develop all sorts of invaluable skills and traits beyond just coding. These include planning, problem solving, communication, logic, empathy, attention to detail, patience, resilience, persistence, and creativity. And it turns out that these skills (especially creativity and creative problem solving) are some of the most in-demand out there. So, coding will help your future career, too, regardless of what that career may be.

But, where to start?

Captain Code is a welcoming, engaging, and fun introduction to becoming a coder, designed for the young (ages 10-17) and young-at-heart. Experienced educators and coders Ben & Shmuel Forta will guide you using Python, one of the most popular programming languages in the world. You'll learn by creating games, yes, games, from simple projects to retro text-based adventures to complete graphical arcade style games. Captain Code is 400 glossy color pages of goodness packed with welcoming images, useful tips and tidbits, and engaging, readable text that focuses on doing while having fun. All code listings are in full-color and QR codes link to bonus content, downloads, challenge solutions, and more.

Captain Code makes coding exciting and rewarding, as it prepares a new generation to take their next steps forwardin education, careers, or both.

So, are you ready to unleash your coding superpower and become Captain Code?

Table of contents

  1. Cover Page
  2. About This eBook
  3. Title Page
  4. Copyright Page
  5. Pearson’s Commitment to Diversity, Equity, and Inclusion
  6. Contents at a Glance
  7. Contents
  8. Register Your Book
  9. Acknowledgments
  10. About the Authors
  11. Introduction
    1. What’s in This Book
    2. Watch Out for These
    3. Getting Help
  12. Figure Credits
  13. Part I: It’s All Fun and Games
    1. Chapter 1. Getting Started
      1. Understanding Computer Programming
      2. Setting Things Up
      3. Writing Your First Python Program
      4. Summary
    2. Chapter 2. Mad Libs
      1. Understanding Functions
      2. Using Variables
      3. Playing Mad Libs
      4. Summary
    3. Chapter 3. Roll the Dice
      1. Using Libraries
      2. “3” Is Not 3
      3. Commenting Your Code
      4. One Die, Two Dice
      5. Summary
    4. Chapter 4. Calculate the Day
      1. Working with Dates
      2. Making Decisions
      3. Beating the Mathematician
      4. Summary
    5. Chapter 5. Rock Paper Scissors
      1. More Strings
      2. Game Time
      3. Summary
    6. Chapter 6. Secret Codes
      1. Lists
      2. Loop-de-Loop
      3. Cracking the Code
      4. Summary
    7. Chapter 7. Guess the Number
      1. Conditional Loops
      2. Game Time
      3. Summary
    8. Chapter 8. Becoming a Coder
      1. How Coders Code
      2. Game Components
      3. Summary
    9. Chapter 9. Hangman
      1. Game Time
      2. So How Does It Work?
      3. Summary
    10. Chapter 10. Keep Going
      1. Birthday Countdown
      2. Tip Calculator
      3. Password Generator
      4. Summary
  14. Part II: On An Adventure
    1. Chapter 11. Getting Func-ky
      1. Functions Revisited
      2. Writing Your Own Functions
      3. Summary
    2. Chapter 12. Exploring
      1. Game Concept
      2. Game Time
      3. Test It
      4. Summary
    3. Chapter 13. Cleanup Time
      1. Optimizing Your Code
      2. String Externalization
      3. Summary
    4. Chapter 14. Reduce, Reuse, Recycle, Refactor
      1. Understanding Refactoring
      2. Creating a User Choice Component
      3. Summary
    5. Chapter 15. Carrying (and Using) Stuff
      1. Planning the Inventory System
      2. The Inventory System
      3. Summary
    6. Chapter 16. Keeping It Classy
      1. The Player System
      2. Creating a Player Class
      3. Using Our New Class
      4. Summary
    7. Chapter 17. Color Your World
      1. Installing Third-Party Libraries
      2. Using Colorama
      3. Summary
    8. Chapter 18. Keep Going
      1. Health and Lives
      2. Shopping for Items
      3. Random Events
      4. Battling Enemies
      5. Saving and Restoring
      6. Summary
  15. Part III: Racing Around
    1. Chapter 19. Crazy Driver
      1. Introducing Pygame
      2. Prepping the Game
      3. Getting Started
      4. The Game Loop
      5. Summary
    2. Chapter 20. Image-ine the Possibilities
      1. Files and Folders
      2. Setting the Background
      3. Placing the Cars
      4. Summary
    3. Chapter 21. We Like to Move It
      1. Moving the Enemy
      2. Moving the Player
      3. Summary
    4. Chapter 22. Crash, Bang, Boom
      1. You Crashed, Game Over
      2. Tracking Score
      3. Increasing Difficulty
      4. Summary
    5. Chapter 23. Finishing Touches
      1. Game Over Revisited
      2. Pause
      3. Varying Enemies
      4. Ice Cubes
      5. Summary
    6. Chapter 24. Keep Going
      1. Splash Screen
      2. Scores and High Scores
      3. Oil Slick
      4. Multiple Enemies
      5. And Then…
      6. Summary
  16. What Next?
    1. There’s a Lot More to Python
    2. Web Development
    3. Mobile App Development
    4. Game Development
    5. And Then…
  17. Index
  18. Code Snippets

Product information

  • Title: Captain Code: Unleash Your Coding Superpower with Python
  • Author(s): Shmuel Forta, Ben Forta
  • Release date: December 2021
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780137653515