DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    59

    2d array, plz help, thank you.

    Hi... first off all b/c its almost newyear... :-)

    Happy newyear




    But... i have a question.

    About 2 dimensional arrays.


    I kinda know how to make them but i dont know how to get the right nr in the array


    Im making a mastermind program and how i thought for myself. Lets make an intelligent codebreaker to automaticly solve the given random nr's



    Ther are 1096 possibilities, there are 5 pegs and 6 different colers in my mastermind game


    How can i make an array so that the computer automaticly solves the given nr?

    Ive treid to make but i just cant figure out how.
    My own java video tutorials, feel free to watch it.
    http://www.engineeringserver.com/for...amming-b311.0/ Need java help? For beginning and intermediate java coders!

  2. #2
    Join Date
    Dec 2004
    Posts
    34
    Is your question about how to make any kind of solution work (even a stupid one), or do you also want some kind of intelligent algorithm?

    by the way, you're doing it the C-structural way, or using OO concepts?

  3. #3
    Join Date
    Sep 2004
    Posts
    59
    Hi, thanks you for replying,



    The program that im trying to make:


    You enter a number and the computer is trying to guess it with the less possible guesses

    there are 4 "pions" with 6 colors so where are 1296 possiblities and NOT 1096 like ive said in my previous posts (sorry i was confused)


    e.g. i use the number: 4216

    The length of the numbers are the pions (1111 = 4 pions)

    The 4/2/1/6/ means the diffrent colors like:
    4 = red,
    2 = cyan,
    1 = white
    4 = red


    Im still trying to find the best method for it but i still havent found anything usefull,

    The only thing i know is to use some 2d arraylist?


    thanks
    Ark
    My own java video tutorials, feel free to watch it.
    http://www.engineeringserver.com/for...amming-b311.0/ Need java help? For beginning and intermediate java coders!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links