Hey all, I've been posed a pretty difficult variation on the typical Number Guessing Game, where you have to think up a secret number, then have the computer guess your number. If the computer's number is greater than yours, then you tell it so, and if it is less than yours, you tell it so, usually via user input. Typically, to optimize guessing, you program it so that it picks the midrange number. In this case, we are using four digits.

However, instead of user input based on less than/greater than, the computer tries to guess a (4-digit) number (between 1000 and 9999), and then you state how many digits in the guess match your secret number. A match must have the s

**ame digit at the same position**. Notice that the only information the computer receives is whether there is a match or not, and how many matches there are. It does NOT know WHAT digit is matching. I am pretty baffled by this program, but I have quite a few ideas.

There are 2 methods I am using:

public int myGuessIs() - returns a guess, and

public void updateMyGuess(int nmatches) - updates the previous guess based on the number of matches and prepares for the next guess

So I am thinking we should use an ArrayList to construct the numbers from 1000 to 9999, first, using a for loop, and we'll call the variable "range" of type int.

Then, I presume we'll need indices for the ArrayList at some point to refer to the numbers. This gets the typical "i" and it is an int also.

Assuming this construction of the list works, I'd want to update the guess based on the user-input number of matches (nmatches). If it is zero, than for a four digit number abcd, I cannot have "a" in the thousands place, "b" in the hundreds place, "c" in the tens place, or "d" in the ones place. I would then somehow have to come up with a way to eliminate all of those possibilities from my ArrayList. In retrospect, the "int" type may be totally useless to tell me about decimal places. Maybe if I somehow converted the int to an int[], or a

String, and then used some String-breaking methods, and somehow identified the "places"...I really haven't the faintest inkling of where to go with this. Some inspiration would be AWESOME. Don't give it all away though :P

So far, I've got what appears below. You'll notice I've slashed in some questions and comments; I'm pretty noob so answers to those would also be MUCH appreciated

THANK YOU VERY MUCH!