Magic 8-Ball

Files Needed

(Do not re-type this program. Simply download a copy of the file by right-clicking and choosing "Save link as..." from the context menu. Save it into your normal code folder.)

What You Should See

Your answers will probably be different than these. Actually, that's kind of the point.

MAGIC 8-BALL SAYS: It is decidedly so


MAGIC 8-BALL SAYS: Reply hazy, try again


MAGIC 8-BALL SAYS: Signs point to yes

Study Drills

  1. The real Magic 8-Ball™ contains 20 responses, not 15. Change the code so that it picks a random number from 1-20, and add the following five responses:

©2013–2015 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License