Thread: How to write a Mastermind game without using array and pointer?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    18
    I've encounterd a problem when comparing the near match, in a single "for loop" I can only compare the numbers of the same position in the 4-digit number, this makes the comparison impossible.

    The good news is that I finally finish the exact match part, that's really a piece of cake with the help of the fake array.

    Do I need to use "looping the loop" or 2 "for loop" to write it or anything else?

  2. #2
    Registered User
    Join Date
    Oct 2007
    Posts
    18
    I am still not able to calculate the number of near match correctly, when repeated numbers exist in the code or the guess, the number of near match may become wrong.
    Can anyone help me?
    Last edited by wtxwt; 10-22-2007 at 05:05 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting the matrix question..
    By transgalactic2 in forum C Programming
    Replies: 47
    Last Post: 12-22-2008, 03:17 PM
  2. Replies: 2
    Last Post: 07-11-2008, 07:39 AM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  4. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM