Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

5. Writing a Program: Extra-Strength Methods > First, a high-level design

First, a high-level design

We know we’ll need classes and methods, but what should they be? To answer that, we need more information about what the game should do.

First, we need to figure out the general flow of the game. Here’s the basic idea:

  1. User starts the game

    1. Game creates three Dot Coms

    2. Game places the three Dot Coms onto a virtual grid

  2. Game play begins

    Repeat the following until there are no more Dot Coms:

    image with no caption
  3. Game finishes

    Give the user a rating based on the number of guesses.

image with no caption

Now we have an idea of the kinds of things the program needs to do. The next step is figuring out what kind of objects we’ll need to do the work. Remember, think like Brad rather than Larry; focus first on the things in the program rather than the procedures.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial