10-31-2022, 09:33 PM
Hi ! Bplus! You brought me a great puzzle for the evening!
I thought a lot about how it could be. I can't check back. Among the solutions is 1, which might be correct. I'm not sure.
I thought a lot about how it could be. I can't check back. Among the solutions is 1, which might be correct. I'm not sure.
Code: (Select All)
'1 3 4 6 7 11
Dim Shared ans(20)
For t = 0 To 4095: ' Locate 1, 1: Print t
For t2 = 1 To 12
ans(t2) = Sgn(t And 2 ^ (t2 - 1))
Next t2
add = 0: count = 0
For t2 = 1 To 12
add = add + Abs(ans(t2) = quest(t2))
count = count + 1
Next t2
If add + 1 = count Then
Print "find: ";:
For t3 = 1 To 12 Step 1
If ans(t3) Then Print t3;
Next t3
Print
End If
Next t
Function quest (which)
Select Case which
Case 1: ans = 1
Case 2: add = 0: For t = 7 To 12: add = add + ans(t): Next t: ans = add = 3
Case 3: add = 0: For t = 2 To 12 Step 2: add = add + ans(t): Next t: ans = add = 2
Case 4: ans = ans(5) And ans(6) And ans(7)
Case 5: ans = ans(2) = 0 And ans(3) = 0 And ans(4)
Case 6: add = 0: For t = 1 To 11 Step 2: add = add + ans(t): Next t: ans = add = 4
Case 7: ans = (ans(2) Or ans(3)) * ((ans(2) And ans(3)) = 0)
Case 8: ans = ans(5) And ans(6) And ans(7)
Case 9: add = 0: For t = 1 To 6: add = add + ans(t): Next t: ans = add = 3
Case 10: ans = ans(11) And ans(12)
Case 11: add = 0: For t = 7 To 9: add = add + ans(t): Next t: ans = add = 1
Case 12: add = 0: For t = 1 To 11: add = add + ans(t): Next t: ans = add = 4
End Select
quest = Abs(Sgn(ans))
End Function