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

Home > Logic
Potluck Dinner (Posted on 2014-01-27) Difficulty: 3 of 5
Six Minikins met at Ekum's house and shared a potluck dinner. At one such gathering, one provided acorn soup, one provided mushrooms, one provided forest greens, one provided a variety of nuts, one provided baked fish, and one provided a favorite dessert made from honey, berries, and grain meal.

From the following statements, which friends brought which dishes, and what was the sequence of their arrival for the dinner?
  1. Ekum was late getting home, so was not the first to arrive.
  2. Ebum did not bring dessert, mushrooms, or nuts, nor was he the first to arrive.
  3. Ekum provided either dessert or nuts, and was not the last to arrive.
  4. The one who arrived first, who was not Epum, provided soup.
  5. Eskum arrived immediately after Evum, who arrived immediately after Epum.
  6. The last to arrive, who was not Eskum, brought the fish.
  7. The one who provided mushrooms, who was not Epum, was the third to arrive.
  8. The one who arrived immediately after Elfum brought the dessert.

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 1

DECLARE SUB permute (a$)
CLS
n$ = "bksvpl": hn$ = n$
DO
  d$ = "smgnfd": hd$ = d$
  DO

    good = 1
    IF LEFT$(n$, 1) = "k" THEN good = 0
    IF LEFT$(n$, 1) = "b" THEN good = 0
    ebix = INSTR(n$, "b")
    IF MID$(d$, ebix, 1) = "d" THEN good = 0
    IF MID$(d$, ebix, 1) = "m" THEN good = 0
    IF MID$(d$, ebix, 1) = "n" THEN good = 0
    ekix = INSTR(n$, "k")
    IF MID$(d$, ekix, 1) <> "d" AND MID$(d$, ekix, 1) <> "n" THEN good = 0
    IF RIGHT$(n$, 1) = "k" THEN good = 0
    IF LEFT$(n$, 1) = "p" THEN good = 0
    IF LEFT$(d$, 1) <> "s" THEN good = 0
    IF INSTR(n$, "pvs") = 0 THEN good = 0
    IF RIGHT$(d$, 1) <> "f" THEN good = 0
    IF RIGHT$(n$, 1) = "s" THEN good = 0
    IF MID$(d$, 3, 1) <> "m" THEN good = 0
    IF MID$(n$, 3, 1) = "p" THEN good = 0
    elix = INSTR(n$, "l")
    IF MID$(d$, elix + 1, 1) <> "d" THEN good = 0
    IF good THEN PRINT n$, d$

    permute d$
  LOOP UNTIL d$ = hd$
 
  permute n$
LOOP UNTIL n$ = hn$

reports

lpvskb        sdmgnf

meaning the sequence was, in order:


E E E E E E
l p v s k b  
f u u k u u
u m m u m m
m     m
s d m g n f
o e u r u i
u s s a t s
p s h i s h
  e r n
  r o
  t o
    m
    s

Words are in columns reading down.


  Posted by Charlie on 2014-01-27 21:43:27
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 (15)
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