|
|
Back to UserFriendly Strip Comments Index
|
now this is fun... | by McNutcase | 2003-02-27 10:06:10 |
|
Mastermind? | by Egaeus | 2003-02-27 10:17:13 |
|
erm, computer sets code, you guess code... | by McNutcase | 2003-02-27 10:20:10 |
| It's been a while |
by Egaeus |
2003-02-27 10:35:14 |
but it's fairly straightforward. You have 5 (I believe) holes into which different colored pegs of some possible number of colors are placed. This is hidden from you. You guess a combination, and the opponent tells you how many are correct. You use this information to deduce what combinations are/aren't possible solutions. Traditionally, two people play, and the person who gets the correct combination first wins. If all you're doing is guessing combinations, it should be easy.
1. Generate random arrangement
2. Prompt for string of letters that represent a color combination (like YYROG), being sure to assign a unique letter for each color
3. Compare string to correct arrangement
4. Tell player the number of correct positions
5. Lather, rinse, repeat until you match all 5
Don't know why Java should be much different than any other language, as long as you can compare the different elements of a string. |
|
[ Reply ] |
|
|
[Todays Cartoon Discussion]
[News Index]
|
|