Chapter 4: Loops and Arrays: The Poker Dice Game

Chapter 4: Loops and Arrays: The Poker Dice Game

Overview

You know all the basic parts of a program now, but your programs can be much easier to write and much more efficient when you know some other things. In this chapter, you'll learn about two very important tools. Arrays are special variables that form lists. Looping structures are used to repeat certain code segments. As you might expect, arrays and loops often work together. You'll learn how to use these new elements to make more interesting programs. Specifically, you'll:

  • Use the for loop to build basic counting structures.

  • Modify the for loop for different kinds of counting.

  • Use a while loop for more flexible looping.

  • Identify the keys to successful loops.

  • Create basic arrays.

  • Write programs that use arrays and loops.

  • Store information in hidden fields.