Results 1 to 8 of 8

Thread: Master Mind

  1. #1

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    Master Mind

    Hi!
    Im Making a game like Master Mind...

    The computer chooses 4 colors and then you have to guess them...Its really fun...

    theres a small problem though....
    When you guess one of the colors correct at the correct position, the computer has to add one black dot at the side, and when you gues one color correct but on the wrong place it adds a white dot...

    the problem with this is that if for example you guess the first color correct and the 3rd color is the same but you didnt gues that color at all it shall not add a white dot for that color (being half correct and fully correct at the same time)...

    also if you guess the first correct and then guess that color later but its not at any more place in the computers colors it shall not get a white dot

    its pretty hard to explain but youll probably get the idea if you play it
    Attached Files Attached Files
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I made a complete mastermind game when I was up at the cottage this year, it works completely. I can give you the source if I still have it...
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    sure!
    that would be great!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  4. #4
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    So.. it works like so:
    colors = numbers

    random: 1314
    upicked: 1333
    Ur saying it adds black + white for the same one??
    Simply have it check the main position for fully correct, then the other ones for half. Once you find one, exit the function.
    Oh, if you have 2 white dots and the user picks 2 whites.. and it checks wrong oen first.. you might want to make sure it checks all of same color for best result first.
    Don't pay attention to this signature, it's contradictory.

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Just remembered that we formatted the laptop a few weeks ago bud... sorry but I can't help
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6
    Addicted Member
    Join Date
    Apr 2002
    Location
    Israel
    Posts
    152
    Hi all,
    I'm not sure if I've understood what you mean but the game looks like one I mad sometime ago mybe that is what you need
    Attached Files Attached Files

  7. #7

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    KingArthur, your project looks alot like mine only i've got 6 possible colors to use in 4 places and if you guess a color that on the wrong place you'll get a 'half-correct' color for that one...
    then the white and black boxes that tells if you've guessed correct, should not be on the correct place...they should be sorted to show fist black, then white, then grey (makes it harder to figure out which colors are correct).
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  8. #8

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    i've made an illustration that shows how this is to be done...
    its kinda hard to explain so i hope this image makes it easier.


    the four colors in the top are the randomized colors thats hidden and that the player is supposed to find out in the correct order!

    the other four colors are just an example of some colors chosen by a player.

    the four black/grey/white colored dots at the right tells how many colors are correct at the correct place (black), and how many colors that are correct at the wrong place (white) (not counting a color twice (the last red does not count as both correct and half-correct)).
    grey is when a color is not correct.

    Attached Images Attached Images  
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width