The sisters of Aaron Green were Betty and Clara; the name of Aaron's girlfriend was Flora Brown and, Duane and Edwin were Flora’s brothers.
Their occupations were as follows:
- Aaron was a doctor.
- Betty was a doctor.
- Clara was a lawyer.
- Duane was a doctor.
- Edwin was a lawyer.
- Flora was a lawyer.
One of the six killed one of the other five. Here are some clues to the murder.
- If the killer and the victim were related, the killer was a man.
- If the killer and the victim were not related, the killer was a doctor.
- If the killer and the victim had the same occupation, the victim was a man.
- If the killer and the victim had different occupations, the victim was a woman.
- If the killer and the victim were of the same sex, the killer was a lawyer.
- If the killer and victim were different sexes, the victim was a doctor.
Who was the killer? Who was the victim?
DIM related(2) AS STRING, male AS STRING, prof AS STRING, names AS STRING
related(1) = "abc": related(2) = "def"
male = "ade"
prof = "ddldll" ' in abcdef order
names = "abcdef"
FOR killer = 1 TO 6
FOR victim = 1 TO 6
IF killer <> victim THEN
k$ = MID$(names$, killer, 1)
v$ = MID$(names$, victim, 1)
rel = 0
FOR i = 1 TO 2
IF INSTR(related(i), k$) > 0 AND INSTR(related(i), v$) > 0 THEN rel = 1
NEXT
IF INSTR(male, k$) > 0 THEN kman = 1: ELSE kman = 0
IF rel = 0 OR kman = 1 THEN
kprof$ = MID$(prof, killer, 1)
IF rel = 1 OR kprof$ = "d" THEN
vprof$ = MID$(prof, victim, 1)
IF INSTR(male, v$) > 0 THEN vman = 1: ELSE vman = 0
IF kprof$ <> vprof$ OR vman = 1 THEN
IF kprof$ = vprof$ OR vman = 0 THEN
IF kman <> vman OR kprof$ = "l" THEN
IF kman = vman OR vprof$ = "d" THEN
PRINT "killer:"; k$, "victim:"; v$
END IF
END IF
END IF
END IF
END IF
END IF
END IF
NEXT
NEXT
finds
killer:b victim:d
so Betty killed Duane.
|
Posted by Charlie
on 2012-08-26 15:42:50 |