Nine Minikins, looking for adventure, decided to float down a nearby river on rafts. Three rafts, identified as #1, #2, and #3, were constructed from bundles of reeds tied with vines. A destination down the river was identified and the three rafts were launched.
One of the rafts, passing under a bridge, was pulled underwater by a troll; the three occupants were able to swim to safety. One raft became waterlogged mid-trip and had to be beached. Only one raft arrived at the predetermined destination.
Based on the following statements, which three Minikins were on which raft and how did each three fare?
- Neither Ekum, Elfum, nor Egum was on raft #2, nor were all three on the same raft.
- Epum and Edum were on the same raft. It was not the one that became waterlogged.
- Evum, whose raft was not pulled underwater by the troll, was not on the same raft as either Egum or Ekum.
- Ebum and Ekum were on the same raft. It was not the one that became waterlogged.
- Egum was on raft #3 along with Eskum.
- Efrum was not on the raft that was pulled underwater by the troll.
DECLARE SUB place (which!)
CLEAR , , 25000
DIM SHARED troll, wlog, succ, name$, raft$(3), fullname$(9)
DATA Ekum,Elfum,Egum,Epum,Edum,Eskum,Ebum,Efrum,Evum
FOR i = 1 TO 9: READ fullname$(i): NEXT
name$ = "klgpdsbfv"
CLS
FOR troll = 1 TO 3
FOR wlog = 1 TO 3
IF wlog <> troll THEN
succ = 6 - wlog - troll
place 1
END IF
NEXT
NEXT
SUB place (which)
n$ = MID$(name$, which, 1)
FOR b = 1 TO 3
IF LEN(raft$(b)) < 3 AND (b <> 2 OR n$ <> "k" AND n$ <> "g" AND n$ <> "l") THEN
raft$(b) = raft$(b) + n$
good = 1
IF n$ = "g" AND raft$(b) = "kl" THEN good = 0
IF n$ = "d" AND (INSTR(raft$(b), "p") = 0 OR b = wlog) THEN good = 0
IF n$ = "v" THEN
IF b = troll THEN good = 0
IF INSTR(raft$(b), "g") > 0 OR INSTR(raft$(b), "k") > 0 THEN good = 0
END IF
IF n$ = "b" AND INSTR(raft$(b), "k") = 0 THEN good = 0
IF n$ = "k" AND b = wlog THEN good = 0
IF (n$ = "g" OR n$ = "s") AND b < 3 THEN good = 0
IF n$ = "f" AND b = troll THEN good = 0
IF good THEN
IF which = 9 THEN
PRINT "troll", "waterlogged", "success"
PRINT troll, wlog, succ
FOR p = 1 TO 3
PRINT fullname$(INSTR(name$, MID$(raft$(troll), p, 1))),
PRINT fullname$(INSTR(name$, MID$(raft$(wlog), p, 1))),
PRINT fullname$(INSTR(name$, MID$(raft$(succ), p, 1)))
NEXT
ELSE
place which + 1
END IF
END IF
raft$(b) = LEFT$(raft$(b), LEN(raft$(b)) - 1)
END IF
NEXT b
END SUB
finds (each column has status, raft number and three riders):
troll waterlogged success
1 3 2
Ekum Egum Epum
Elfum Eskum Edum
Ebum Efrum Evum
|
Posted by Charlie
on 2013-08-26 17:11:39 |