In this problem the puzzles each contain a series of statements. However you will find (or will have to find) that one statement is false. It will be necessary for you to find the false one in order to solve the puzzle.
The Midville Muddlers baseball team depends on four players to score most of their runs. The positions of the four are the three outfielders (rightfielder, centerfielder, and leftfielder) and the catcher. From the statements that follow, determine the first name (Henry, Ken, Leo, or Stan), surname (Dodson, Brooks, Clements, or Ashley), position, and batting average of each player. (The averages: .280, .295, .310, .325)
1. Neither Leo nor the catcher has a batting average over .300.
2. Three who are neighbors are Clements, the rightfielder, and the player who bats .325.
3. The centerfielder bats .295.
4. Stan's batting average is 30 points higher than that of Ken, who does not live near any of the other three.
5. Brooks and Henry, who is not Ashley, both bat over .300 and are in competition to see which will score the most runs this season.
6. Henry, who is neither the rightfielder nor the leftfielder, has a lower batting average than the catcher.
Remember one of these is false.
DECLARE SUB permute (a$)
CLS
first$ = "hkls"
surname$ = "dbca"
ba$ = "8912"
FOR fp = 1 TO 24
permute first$
IF MID$(first$, 4, 1) <> "l" AND MID$(first$, 4, 1) <> "h" THEN
FOR sp = 1 TO 24
permute surname$
ix = INSTR(first$, "h")
IF MID$(surname$, 1, 1) <> "c" AND MID$(surname$, ix, 1) <> "b" THEN
FOR bp = 1 TO 24
permute ba$
ix = INSTR(ba$, "2")
IF MID$(surname$, ix, 1) <> "c" AND ix <> 1 THEN
FOR i = 1 TO 4
SELECT CASE MID$(ba$, i, 1)
CASE "8"
ba(i) = 280
CASE "9"
ba(i) = 295
CASE "1"
ba(i) = 310
CASE "2"
ba(i) = 325
END SELECT
NEXT i
s1 = 1: s2 = 1: s3 = 1: s4 = 1: s5 = 1: s6 = 1
ix = INSTR(first$, "l")
IF ba(ix) > 300 THEN s1 = 0
IF ba(4) > 300 THEN s1 = 0
IF ba(2) <> 295 THEN s3 = 0
sba = ba(INSTR(first$, "s"))
kba = ba(INSTR(first$, "k"))
IF sba <> kba + 30 THEN s4 = 0
IF s4 > 0 THEN
ix = INSTR(first$, "k")
IF MID$(surname$, ix, 1) = "c" THEN s2 = 0
IF ix = 1 THEN s2 = 0
IF ba(ix) = 325 THEN s2 = 0
END IF
ix = INSTR(first$, "h")
IF MID$(surname$, ix, 1) = "a" THEN s5 = 0
bba = ba(INSTR(surname$, "b"))
hba = ba(INSTR(first$, "h"))
IF bba < 300 OR hba < 300 THEN s5 = 0
IF ix = 1 OR ix = 3 THEN s6 = 0
IF ba(ix) > ba(4) THEN s6 = 0
ct = s1 + s2 + s3 + s4 + s5 + s6
IF ct > 4 THEN
PRINT first$: PRINT surname$: PRINT ba(1); ba(2); ba(3); ba(4)
PRINT ct, s1; s2; s3; s4; s5; s6
END IF
END IF
NEXT
END IF
NEXT sp
END IF
NEXT fp
SUB permute (a$)
DEFINT AZ
x$ = ""
FOR i = LEN(a$) TO 1 STEP 1
l$ = x$
x$ = MID$(a$, i, 1)
IF x$ < l$ THEN EXIT FOR
NEXT
IF i = 0 THEN
FOR j = 1 TO LEN(a$) \ 2
x$ = MID$(a$, j, 1)
MID$(a$, j, 1) = MID$(a$, LEN(a$)  j + 1, 1)
MID$(a$, LEN(a$)  j + 1, 1) = x$
NEXT
ELSE
FOR j = LEN(a$) TO i + 1 STEP 1
IF MID$(a$, j, 1) > x$ THEN EXIT FOR
NEXT
MID$(a$, i, 1) = MID$(a$, j, 1)
MID$(a$, j, 1) = x$
FOR j = 1 TO (LEN(a$)  i) \ 2
x$ = MID$(a$, i + j, 1)
MID$(a$, i + j, 1) = MID$(a$, LEN(a$)  j + 1, 1)
MID$(a$, LEN(a$)  j + 1, 1) = x$
NEXT
END IF
END SUB
finds
slhk
bcda
310 295 325 280
5 1 1 1 1 1 0
meaning, in order RF, CF, LF, C, the first names are Stan, Leo, Henry, Ken; the last names are Brooks, Clements, Dodson, Ashley; the batting averages are .310, .295, .325, .280, respectively. There are 5 true statements, the last being the lie.

Posted by Charlie
on 20050415 20:15:58 