This puzzle is borrowed from   math-frolic.blogspot.



Given the following twelve statements, which of them are true?

 1.  This is a numbered list of twelve statements.
 2.  Exactly 3 of the last 6 statements are true.
 3.  Exactly 2 of the even-numbered statements are true.
 4.  If statement 5 is true, then statements 6 and 7 are both true.
 5.  The 3 preceding statements are all false.
 6.  Exactly 4 of the odd-numbered statements are true.
 7.  Either statement 2 or 3 is true, but not both.
 8.  If statement 7 is true, then 5 and 6 are both true.
 9.  Exactly 3 of the first 6 statements are true.
10.  The next two statements are both true.
11.  Exactly 1 of statements 7, 8 and 9 are true.
12.  Exactly 4 of the preceding statements are true.



Task

When you get tired of trying to figure it out in your head,
write a program to solve it, and print the correct answer or answers.



Extra credit

Print out a table of near misses, that is, solutions that are contradicted by only a single statement.




Dim As Integer nEnunciados = 12, intento, enun, errado
Dim As Integer Afirm(nEnunciados), T(nEnunciados)
 
For intento = 0 To 2^nEnunciados-1
    REM Postular respuesta:
    For enun = 1 To 12
        T(enun) = (intento And 2^(enun-1)) <> 0
    Next enum
 
    REM Prueba de consistencia:
    Afirm(1)  = T(1) = (nEnunciados = 12)
    Afirm(2)  = T(2) = ((T(7)+T(8)+T(9)+T(10)+T(11)+T(12)) = -3)
    Afirm(3)  = T(3) = ((T(2)+T(4)+T(6)+T(8)+T(10)+T(12)) = -2)
    Afirm(4)  = T(4) = ((Not T(5) Or (T(6) And T(7))))
    Afirm(5)  = T(5) = (Not T(2) And Not T(3) And Not T(4))
    Afirm(6)  = T(6) = ((T(1)+T(3)+T(5)+T(7)+T(9)+T(11)) = -4)
    Afirm(7)  = T(7) = ((T(2) Or T(3)))
    Afirm(8)  = T(8) = ((Not T(7) Or (T(5) And T(6))))
    Afirm(9)  = T(9) = ((T(1)+T(2)+T(3)+T(4)+T(5)+T(6)) = -3)
    Afirm(10) = T(10) = (T(11) And T(12))
    Afirm(11) = T(11) = ((T(7)+T(8)+T(9)) = -1)
    Afirm(12) = T(12) = ((T(1)+T(2)+T(3)+T(4)+T(5)+T(6) + T(7)+T(8)+T(9)+T(10)+T(11)) = -4)
 
    Dim As Integer suma = 0
    For cont As Integer = 1 To 12
        suma += Afirm(cont)
    Next cont
 
    Select Case suma
    Case -11
        Color 7: Print "Casi resuelto, con los enunciados ";
        For enun = 1 To 12
            If T(enun) Then Print ; enun; " ";
            If Not Afirm(enun) Then errado = enun
        Next enun
        Print "verdaderos (falsos"; errado; ")."
    Case -12
        Color 10: Print "­Resuelto! con los enunciados ";
        For enun = 1 To 12
            If T(enun) Then Print ; enun; " ";
        Next enun
        Print "verdaderos."
    End Select
Next intento
Sleep