Because it was wished I uploaded the source code. I also uploaded a new version and greetings to the 17 guys who downloaded the previous version before
What I changed:
If the program hit the end of the list a popup window show up, means when only 1 solution is possible any more or when you did something wrong.
I also modified the scoring when every solution seems the have the same scoring the program tries to make a guess by targeting the solution which "hide" the most
Code: Select all
if (bestscore <= 1 || (isallequal && list.Count > 1))
{
bestscore = 500;
foreach (Code element in list)
{
int guess = element.getNum();
int score = 0;
foreach (Code element2 in list)
{
score = score + (element2.guessGreen(guess)+ element2.guessRed(guess));
}
if (score < bestscore)
{
bestscore = score;
bestchoice = guess;
}
}
}
Maybe I will add a check box in the next version where you can flip around that behaviour but since it is an exception handling I don't see a point for it.
In short:
- added popup window
- improve scoring
- changed start number