Results 1 to 2 of 2
Thread: Mastermind game problem
- 04-16-2011, 03:02 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
-
Think through the logic on paper first -- how would you check for a win if you were doing this on paper and without a computer since the solution would fall out of this.
A couple of considerations:
- Consider just checking for correct number/position first, meaning check only if position i == guess i before checking any positions for correct number but incorrect position.
- Consider setting a match to some placeholder value. For instance if any numbers match, consider changing them to -1 (but then don't allow matching -1's to be valid) so you know not to use that guess and that answer's number again.
Please note that I added code tags to your post to allow your pasted code to retain its formatting and be readable. To do this yourself, please check the link on how to use code tags immediately below.
Similar Threads
-
problem mastermind
By Alexander_003 in forum AWT / SwingReplies: 4Last Post: 03-16-2011, 05:08 PM -
MasterMind Assignement , Use of String Class
By Ebayer in forum New To JavaReplies: 2Last Post: 03-14-2011, 06:23 PM -
Mastermind!
By MishkaRX in forum New To JavaReplies: 11Last Post: 12-14-2010, 01:39 PM -
MasterMind Problem!!
By papinhio in forum New To JavaReplies: 4Last Post: 07-09-2010, 03:51 PM -
how to make mastermind game
By javabeginer in forum New To JavaReplies: 10Last Post: 04-14-2009, 02:11 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks