K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
"If the facts don't fit the theory, get new facts" --Albert Einstein
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Put the "no match" line outside for loop. Add "break" inside if once matched and the else is redundant
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
"If the facts don't fit the theory, get new facts" --Albert Einstein
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Kris Danielewski wrote:Well, what I am trying to do is search for the char user enter in the hidden word and the return how many letters he found and what are they and on which position...
I wonder if I would create x JButton of the lenght of hidden word and somehow make them empty , i could then make them apper if user enter correct char, can I do that?
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Kris Danielewski wrote:
salvin francis wrote:
Campbell Ritchie wrote:Don't even try with a String. At least two possibilities:
Put the letters into a char[] array; there is a String method which does that very easily.
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Kris Danielewski wrote:im not there yet , because last bit doesn't replace my dashes
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Kris Danielewski wrote:It's Ok.
Any idea how to replace an index of inp[] if letter was found in ary[i], that would be happy ending.
"If the facts don't fit the theory, get new facts" --Albert Einstein
Hunter McMillen wrote: then put the correct guess in the hiddenWord at the same index.
Kris Danielewski wrote:
Hunter McMillen wrote: then put the correct guess in the hiddenWord at the same index.
I stuck at this bit ;p , Your example is the same way we are trying to achive. I mean , I am trying ...
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
"If the facts don't fit the theory, get new facts" --Albert Einstein
Paul Yule wrote:
char[] input = new char[ary.length];
Don't get me started about those stupid light bulbs. |