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

Home > Logic
Festival and Games (Posted on 2013-04-29) Difficulty: 3 of 5
A festival was held each autumn by the Minikins, and there was much feasting and many contests. At one such time, Ekum, Elfum, Eskum, and Evum each won a first place in one of these events: acorn gathering, dancing, singing, and huckleberry eating; not necessarily in that order.

Curiously, each winner also won a second place and a third place in two other of these four events. From the statements below find out who won first place, who won second place, and who won third place in each of the four events.
  1. The one who placed second in huckleberry eating was third in dancing.
  2. The winner of the singing contest placed third in huckleberry eating.
  3. Evum did not place first in acorn gathering or dancing.
  4. Evum was a close second place behind Eskum in one of the four events.
  5. Elfum placed third in singing, but did not place in acorn gathering, and was not first in dancing.

No Solution Yet Submitted by K Sengupta    
No Rating

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

DECLARE SUB show (a$)
DECLARE SUB permute (a$)
CLS
DIM SHARED name$(4)
name$(1) = "Ekum"
name$(2) = "Elfum"
name$(3) = "Eskum"
name$(4) = "Evum"

acorn$ = "klsv": ha$ = acorn$
good = 1
DO
    dance$ = "klsv": hd$ = dance$
    DO
        good = 1
        FOR i = 1 TO 4
            IF MID$(acorn$, i, 1) = MID$(dance$, i, 1) THEN good = 0
        NEXT
        IF good THEN
            sing$ = "klsv": hs$ = sing$
            DO
                good = 1
                FOR i = 1 TO 4
                    IF MID$(acorn$, i, 1) = MID$(sing$, i, 1) THEN good = 0
                    IF MID$(dance$, i, 1) = MID$(sing$, i, 1) THEN good = 0
                NEXT
                IF good THEN
                    huckle$ = "klsv": hh$ = huckle$
                    DO
                        good = 1
                        FOR i = 1 TO 4
                            IF MID$(acorn$, i, 1) = MID$(huckle$, i, 1) THEN good = 0
                            IF MID$(dance$, i, 1) = MID$(huckle$, i, 1) THEN good = 0
                            IF MID$(sing$, i, 1) = MID$(huckle$, i, 1) THEN good = 0
                        NEXT
                        IF good THEN
                            IF MID$(huckle$, 2, 1) = MID$(dance$, 3, 1) THEN
                                IF MID$(sing$, 1, 1) = MID$(huckle$, 3, 1) THEN
                                    IF MID$(acorn$, 1, 1) <> "v" AND MID$(dance$, 1, 1) <> "v" THEN
                                        IF (LEFT$(acorn$, 2) = "sv") + (LEFT$(dance$, 2) = "sv") + (LEFT$(sing$, 2) = "sv") + (LEFT$(huckle$, 2) = "sv") = -1 THEN
                                            IF MID$(sing$, 3, 1) = "l" AND MID$(dance$, 1, 1) <> "l" THEN
                                                IF INSTR(acorn$, "l") > 2 THEN
                                                    PRINT "acorn gathering:"; : show acorn$
                                                    PRINT "dancing:"; : show dance$
                                                    PRINT "singing:"; : show sing$
                                                    PRINT "huckleberry eating:"; : show huckle$
                                                    PRINT
                                                END IF
                                            END IF
                                        END IF
                                    END IF
                                END IF
                            END IF
                        END IF

                        permute huckle$
                    LOOP UNTIL huckle$ = hh$
                END IF
                permute sing$
            LOOP UNTIL sing$ = hs$
        END IF
        permute dance$
    LOOP UNTIL dance$ = hd$
    permute acorn$
LOOP UNTIL acorn$ = ha$

DEFSNG A-Z
SUB show (a$)
  FOR p = 1 TO 4
  FOR i = 1 TO 4
    IF MID$(name$(i), 2, 1) = MID$(a$, p, 1) THEN PRINT " "; name$(i);
  NEXT
  NEXT
  PRINT
END SUB

finds these orders of finish:

acorn gathering: Eskum Evum Ekum Elfum
dancing: Ekum Elfum Eskum Evum
singing: Evum Ekum Elfum Eskum
huckleberry eating: Elfum Eskum Evum Ekum


  Posted by Charlie on 2013-04-29 18:18:57
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information