Public Zone 公開區 > Bookwyrm 書蟲天地

Einstein riddle

<< < (2/2)

hangchoi:

--- Quote from: q on 20 September 2015, 22:15:36 ---I think I have the answer... took me 9:59.9999 minutes   ;D

--- End quote ---

Q, you should be far smarter than me. How come you solved it just 0.0001 sec faster? I expect you can solve it without drawing a chart in 1 minute.  >:(

hangchoi:

--- Quote from: kido on 20 September 2015, 23:34:48 ---Interestingly, I have a solution, in 18ms, LOL. :o

I solved it, with the help of a computer, which the solution comes out instantaneously, in 18ms.


--- Code: ---| ?- solution(Houses).

Houses = [(nigel,purple,tiger,green_tea,daily_express),(vlad,blue,stallion,vodka,guardian),(jez,red,eagle,milk,morning_star),(donald,green,fish,coffee,daily_mail),(liz,white,corgis,beer,times)] ? a

(18 ms) no

--- End code ---

The above is a list containing the solution, first tuple is the first house's characteristics, etc.  It's a Prolog program.


 

--- End quote ---


You should start counting when you write the program.......  8)

kido:

--- Quote from: hangchoi on 21 September 2015, 15:23:50 ---
You should start counting when you write the program.......  8)

--- End quote ---

ok, ok, I confess.  I used 3+ hrs to write it up.

wongyan:
you guys are really really smart.  I was totally lost!!!

Navigation

[0] Message Index

[*] Previous page

Go to full version