I am working on a game on a client server / server in C and I am still done. My programs work, and it solves the secret of an average of 6-7 guesses. Then I browsed the internet and found Donald Knuth's approach:
- Create a set S of remaining features (there are currently 1296). The first assumption is abab.
- Remove all possibilities from S that would not give the same score of color and white pins if they were the answer.
- For each possible guess (not necessarily in S), calculate how many possibilities from S will be eliminated for each possible color / white. The best indicator is values. Play the guess with the highest score (minimax).
- Go back to step 2 until you get it right.
What I have to say here is that I use 5 positions and 8 colors.
As I try to optimize my program, itβs hard for me to understand what Step 3 would look like, in particular, calculating which guess would eliminate most of the possibilities.
I know that I have to look at each element and compare it with everyone, but I'm not sure how to compare it, since I have no white / black values. And I'm wondering how I can determine which record that meets certain conditions will exclude the maximum possibilities.
source share