All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Musket Mettle (Posted on 2013-02-07)
During an uneventful period on the open sea, Captain Lafoot and his four mates decided to try their skill with muskets. They placed a target behind the forecastle and, keeping score they took turns shooting at it.

Based on the following statements, determine how each of five men ranked in the scoring.
1. Captain Lafoot did not rank third unless Red Beard ranked fifth.
2. If Long John ranked second, then Black Jack did not rank either first or third.
3. If Will Kidd did not rank first, then Red Beard ranked second and Long John ranked fourth.
4. If Black Jack did not rank first, then Long John ranked second and Captain Lafoot ranked fourth.
5. If Black Jack did not rank second, then neither did Captain Lafoot nor Red Beard, unless Will Kidd ranked fourth.

 No Solution Yet Submitted by K Sengupta Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 2

' l = lafoot
' j = long john
' k = kidd
' b = black jack
' r = red beard

DECLARE SUB permute (a\$)
CLS
a\$ = "ljkbr": h\$ = a\$
DO
good = 1
IF MID\$(a\$, 3, 1) = "l" AND MID\$(a\$, 5, 1) <> "r" THEN good = 0
IF MID\$(a\$, 2, 1) = "j" AND (MID\$(a\$, 1, 1) = "b" OR MID\$(a\$, 3, 1) = "b") THEN good = 0
IF MID\$(a\$, 1, 1) <> "k" AND (MID\$(a\$, 2, 1) <> "r" OR MID\$(a\$, 4, 1) <> "j") THEN good = 0
IF MID\$(a\$, 1, 1) <> "b" AND (MID\$(a\$, 2, 1) <> "j" OR MID\$(a\$, 4, 1) <> "l") THEN good = 0
IF MID\$(a\$, 2, 1) <> "b" AND MID\$(a\$, 4, 1) <> "k" AND (MID\$(a\$, 2, 1) = "l" OR MID\$(a\$, 2, 1) = "r") THEN good = 0
IF good THEN PRINT a\$
permute a\$
LOOP UNTIL a\$ = h\$

finds

kjrlb

meaning the order of finish was

Will Kidd
Long John
Red Beard
Captain Lafoot
Black Jack

 Posted by Charlie on 2013-02-07 15:08:32

 Search: Search body:
Forums (0)