June 2021
Beginner
336 pages
7h 11m
English

When writing large programs, it’s important to organize our code into smaller logical pieces, each of which contributes to the overall goal. That way, we’ll be able to think about each piece on its own, without worrying about what other pieces are doing. Then we’ll put the pieces together. These pieces are called functions.
In this chapter, we’ll use functions to break down and solve two problems: calculating the score in a two-player card game and determining whether boxes of action figures can be nicely organized.
In this problem, we’ll implement a two-player card game. As part of thinking ...