Esther is engaged. Her fiancé is either Arthur, Barton, Claude, or Dexter.
- Each of the four men and Esther is a knight or a liar.
- Arthur says: "Exactly one of us four men is a knight."
- Barton says: "Exactly one of us four men is a liar."
- Claude says: "Arthur or Barton is Esther’s fiancé."
- Esther says: "My fiancé and I are either
both knights, or both of us are liars."
Who is Esther's fiancé?
FOR fiance = 1 TO 4
FOR a = 0 TO 1
FOR b = 0 TO 1
FOR c = 0 TO 1
FOR d = 0 TO 1
FOR e = 0 TO 1
totkt = a + b + c + d
totliar = 4 - totkt
IF (a = 1) = (totkt = 1) THEN
IF (b = 1) = (totliar = 1) THEN
IF (c = 1) = (fiance = 1 OR fiance = 2) THEN
SELECT CASE fiance
CASE 1
f = a
CASE 2
f = b
CASE 3
f = c
CASE 4
f = d
END SELECT
IF (e = 1) = (e = f) THEN
PRINT MID$("ABCD", fiance, 1), a; b; c; d; e
END IF
END IF
END IF
END IF
NEXT
NEXT
NEXT
NEXT
NEXT
NEXT fiance
finds
B 0 1 1 1 0
B 0 1 1 1 1
meaning
Esther's fiance is Barton. Arthur is a liar. Everyone else is a knight, except for Esther, who could be either a liar or a knight.
|
Posted by Charlie
on 2013-03-25 11:29:29 |