Very URGENT

I need to develop a small Mastermind game using no graphics, just the prompt of the compiler.

The game:

The system chooses a random number of 5 characters (e.g: 56897), then ask the player to guess a number of the same length of characters. If the number suggested matched the one chosen by the system a message is given to the player that he/she won, and if the number did not matched wholly the number of the system, she/he should be given a feed back of how many good characters exist in the suggested number which are well placed and how many which are badly placed. the number of guesses is 10 after which the game finishes.

If any of you wishes to help me, Please look at the following link to see what I managed to do so far. It is not completed as I am stucked.

http://www.easyknowledge.co.uk/mastermind.html

Please,please I really need help

many than in advance

Kind Regards

Daniel

[945 byte] By [tonymontannaa] at [2007-10-2 22:09:40]
# 1

* Don't tell us it's urgent. Nobody cares. It is 100% guaranteed NOT to get you help any faster. If it has any effect whatsoever, it will be to annoy people into ignoring you.

* Provide a meaningful subject line that says something about what specific problem you're having.

* Provide a meaningful message that says something about what specific problem you're having. Postig your assignment and saying "help" is not effective. Asking others to click a link is not effective. Ask specific questions, and post the relevant portions of your code.

(When you post code, please use[code] and [/code] tags as described in [url=http://forum.java.sun.com/help.jspa?sec=formatting]Formatting tips[/url] on the message entry page. It makes it much easier to read.)

jverda at 2007-7-14 1:26:28 > top of Java-index,Java Essentials,Java Programming...
# 2
tell us what java gives as error!
geomana at 2007-7-14 1:26:28 > top of Java-index,Java Essentials,Java Programming...
# 3
At wht point do u have a problem? I see the game pretty straightforward
hello_javaa at 2007-7-14 1:26:28 > top of Java-index,Java Essentials,Java Programming...
# 4
@Op...and please use English variable and method names when you post code on an international forum.
kajbja at 2007-7-14 1:26:28 > top of Java-index,Java Essentials,Java Programming...
# 5
> @Op> > ...and please use English variable and method names> when you post code on an international forum.American English names
macrules2a at 2007-7-14 1:26:28 > top of Java-index,Java Essentials,Java Programming...
# 6
> > @Op> > > > ...and please use English variable and method> names> > when you post code on an international forum.> > American English names:p
kajbja at 2007-7-14 1:26:28 > top of Java-index,Java Essentials,Java Programming...
# 7

Sorry guys! If my first message sounded arrogant, the truth is it is a bit of ignorance and a bit of panic and as I am novice I did not know how to put it.

I am coding a small "Mastermind" game. I need to compare the number entered by the user against the name the system has generated. What I don't know to do is:

How to extract the position of digits of the number the user entered to give him/her a feedback which of them are correct and well placed and which are correct but wrongly placed. here is a snippet of how I compared them as whole but I have no idea how to go on one by one:

public Boolean verify(int theNumber)

{

boolean foundIt = false;

int i = 0;

int numOfCorrectChar = 0;

String convertedSecretNum = new String();

String guessedNumConverted = new String();

convertedSecretNum= String.valueOf(secretNumber);

guessedNumConverted = String.valueOf(theNumber);

while(!guessedNumConverted.contentEquals(convertedSecretNum)

{

j++;

foundIt = true;

}

if(foundIt)

{

System.out.println("You have won");

exit();

}else

{

myObject.checkEachChar(convertedSecretNum, guessedNumConverted);

}

//厖厖厖厖厖厖厖厖厖厖厖厖厖厖厖厖厖?

public static void checkEachChar(

String correctNom, String testNom)

{

char[] proposedSolution = new char[5];

char[] mySolution = new char[5];

int len = proposedSolution.length();

boolean foundIt = false;

int j = 0;

while (!searchMe.regionMatches(j, proposedSolution[], 0, len)) {

i++;

foundIt = true;

}

if (foundIt) {

System.out.println(searchMe.substring(i, i+len));

}

}

}

Thanx so much

tonymontannaa at 2007-7-14 1:26:28 > top of Java-index,Java Essentials,Java Programming...