The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

now this is fun... by McNutcase2003-02-27 10:06:10
  Mastermind? by Egaeus2003-02-27 10:17:13
    erm, computer sets code, you guess code... by McNutcase2003-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]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)