DevX Home Today's Headlines   Articles Archive   Tip Bank   Forums

# Thread: 2d array, plz help, thank you.

1. Registered User
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.

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.

2. Registered User
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. Registered User
Join Date
Sep 2004
Posts
59

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

#### Posting Permissions

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

 FAQ Latest Articles Java .NET XML Database Enterprise