Background
jLogo Programming
- Commanding a Turtle
- Pseudocode
- Adding New Commands
- Iteration & Animation
- Hierarchical Structure
- Procedure Inputs
- Operators & Expressions
- Defining Operators
- Words & Sentences
- User Interface Events
- What If? (Predicates)
- Recursion
- Local Variables
- Global Variables
- Word/Sentence Iteration
- Mastermind Project
- Turtles As Actors
- Arrays
- File Input/Output
Java
- A Java Program
- What's a Class?
- Extending Existing Classes
- Types
- Turtle Graphics
- Control Flow
- User Interface Events
Appendices
- Jargon
- What Is TG?
- TG Directives
- jLogo Primitives
- TG Editor
- Java Tables
- Example Programs
- Installation Notes
Updates
- December 13, 2008
- January 6, 2012
- March 15, 2013
- January 20, 2014
- February 13, 2014
- July 29, 2014
- January 18, 2016
- January 29, 2016
Lastly
Mastermind Applet
The object of Mastermind is to guess a secret code that the program has chosen. The computer randomly picks four colors from a pallet of six. In this version of Mastermind, all four colors are unique, i.e., duplicates are not allowed in the secret code.
Mastermind Applet |
To play the game, you select colors from the column of six choices, filling in the row of empty frames which makes up your current guess. Unlike the secret code, your guess may contain duplicate color choices if this helps you solve the puzzle.
Clicking the left mouse button on a color, fills the current empty box. If you change your mind, clicking on the "Clear Color" button, clears your previous choice. When your guess is complete, clicking on the "Guess" button provides feedback on the guess.
If the guess is correct, "You Win" is displayed. Otherwise, two hints are given as feedback:
- the number of correct choices in the guess (in black), and
- the number of choices that are a correct color, but are not in the proper position in the sequence (in grey).
If you didn't win, and there is still room on the display, another set of empty boxes are drawn for your next guess.
When you run out of room for another guess, "You Lose" is displayed.