17EXPANDING TO HIGHER-DIMENSION ARRAYS

image

In the previous two chapters, you learned how to use one-dimensional arrays to store collections of items. In this chapter, we’ll expand this concept to two dimensions and higher. Working in more than one dimension is also called working in higher dimensions.

In a two-dimensional (2D) array, you can store values in a table or a grid. For example, think about the scoreboard at a baseball game (see Figure 17-1). The left column lists the team names, and the right columns list the innings and other statistics.

Figure 17-1: Baseball scoreboard

The arrays you’ll make in this chapter are similar to a scoreboard. ...

Get Learn to Program with Small Basic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.