Ticker Applet
Computer Games: Mastermind

A lot of people scoff at computer games, but from the programmer's point of view, a good game can be at least as challenging as more serious software. A game program typically includes a subroutine to:



Games of thought can only have an input, processing and output routine, and may sometimes lack the superb animation of arcade games, but they still serve their purpose.

Here is a game of mastermind: You are required to guess a 4- digit number. To make the game easier, you are assured that no two digits are the same, so the number is actually between 0123 and 9876. For each guess, you are given the number of correct digits, plus the number of digits which are in the proper place, as well. For example, if the hidden number is 2034, a guess of 6724 will yield two correct digits, one of them being in the right position, too. Out of range values will default to acceptable numbers. By partially modifying your previous answers, you can get at the right number much faster than you may think at first. The program will give you 12 tries, but when you get used to the game, you should only need about 8. Hint: Unless you are exceptionally fortunate, you may want your first two tries to be something like 1234 and 5678. Good luck! (Javascript required.)

If you are script- minded, here is the source code.

You may have noticed there is also a new animated fractals section.


Electronics links:

  • Simplified Analog Electronics Simulation
  • Data converters
  • Video Digitizer
  • Thermionic valves look like depletion nMOS
  • Transient response
  • Under 50- chip discrete Microcontroller
  • 2x OverSampling Digital Filter Click Here!
  • More Simulation: Finite Elements For electrostatic Field Computation

    Computing Projects:
  • Computer Chess
  • Fractals! Click here!
  • Discrete Correlation
  • RLE For Image Compression
  • Discrete Convolution For Image Processing
  • Newton's Method For Complex Polynomials

  • Non- frames version

    The distinction is somewhat arbitrary: Most of the electronics sections involve use of a computer to some extent, and vice versa. 1