while porting 60_mastermind to rust, I came across a peculiar issue, here in mastermind.bas (the flawed logic is present in every other port I looked at too):
1010 FOR X=1 TO P
1020 GOSUB 3500
1030 IF I(X)=0 THEN 1070
1035 GOSUB 6500
1040 GOSUB 4000
1050 GOSUB 4500
1060 IF B1<>B OR W1<>W THEN I(X)=0
1070 NEXT
this code basically looks through every possible combination,
for all that haven't already been marked as impossible (with previously given player feedback),
it checks whether or not the black and white pins that that combination should get are not-equal to what the previous guess got ... if they are equal, the combination is marked as possible, if they aren't equal then the combination is marked as impossible
the issue is, this almost always will mark the correct answer as impossible, unless its first guess happens to be right
a potential fix (that I can't test but did work in my rust port), is changing that logic from 1060 IF B1<>B OR W1<>W THEN I(X)=0
to 1060 IF B1>B OR W1>W THEN I(X)=0
which, as compared to 1060 IF B1>B OR W1>W THEN I(X)=0
, makes the computer a bit more powerful, and actually able to win with some consistency
note: it could very well be that I messed something up in my implementation, hence why I'm making this issue, in case people agree that this is a problem I'll be making a PR to fix it that I'll link to in the comments
edit: typo