© Jeanine Meyer 2018
Jeanine MeyerHTML5 and JavaScript Projectshttps://doi.org/10.1007/978-1-4842-3864-6_6

6. Add to 15 Game

Jeanine Meyer1 
(1)
New York, USA
 
In this chapter, you will learn the following:
  • Implementing a known real-world game as a digital program with “the computer” as one of the players

  • Developing a strategy for “the computer”

  • Inserting a pause

  • Working with arrays and strings

Introduction

The two-player game Add to 15 requires players to take turns choosing from the numbers 1 to 9 with the goal of obtaining a set of three numbers that add up to 15. I first saw this game at the Museum of Mathematics in New York City where it was implemented as an apparatus with the numbers on rods that could be moved from the center to the player’s side. ...

Get HTML5 and JavaScript Projects: Build on your Basic Knowledge of HTML5 and JavaScript to Create Substantial HTML5 Applications 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.