Recent

Author Topic: Riddle challenge  (Read 2284 times)

LV

  • Full Member
  • ***
  • Posts: 249
Re: Riddle challenge
« Reply #15 on: February 04, 2025, 07:20:32 am »
With 5 attributes, each having 5! permutations, that's (5!)^5 = 24^5 = 7962624 possible combinations—about 8 million. Yes, the problem can be solved in a few steps with human intelligence and a bit of patience. Thank you, Joanna. I’m now taking the subway to work while solving riddles on my smartphone.  :)

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1362
Re: Riddle challenge
« Reply #16 on: February 04, 2025, 09:17:03 am »
Good news I solved it.  :D

What I did was made some rectangles of paper with the clues written on them then I taped the matching clues together and arranged the papers in order and continued taping the ones I was sure about together.

There was some confusion whether the ivory and green houses should be 3&4 or 4&5 but then I noticed that the red house for Englishman had to be the 3rd house because there was no other place for it.

After that I continued using clues and process of elimination to complete the rest of it. That was pretty fun  :)
« Last Edit: February 04, 2025, 09:51:55 am by Joanna from IRC »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

dbannon

  • Hero Member
  • *****
  • Posts: 3319
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Riddle challenge
« Reply #17 on: February 04, 2025, 01:10:14 pm »
Gee, thought someone here would try for a FPC version ?

Here is mine, slow, difficult to read, fun to write.

Thanks Joanna

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Thaddy

  • Hero Member
  • *****
  • Posts: 16820
  • Ceterum censeo Trump esse delendam
Re: Riddle challenge
« Reply #18 on: February 04, 2025, 01:12:24 pm »
Let me give it a try with my fiveway logic and sets. Report later if it makes sense. My gut feeling is that sets removes at least the permutations squared part.
« Last Edit: February 04, 2025, 01:14:03 pm by Thaddy »
Changing servers. thaddy.com may be temporary unreachable but restored when the domain name transfer is done.

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1362
Re: Riddle challenge
« Reply #19 on: February 04, 2025, 03:41:25 pm »
Gee, thought someone here would try for a FPC version ?
Here is mine, slow, difficult to read, fun to write.
Thanks Joanna
Davo
I wasn’t really planning to make code but regardless I think it’s a good idea to solve it manually to really understand it. The first 3 houses were the easiest to start with and the ivory and green house being adjacent .

The Englishman living in red house eliminated all other houses with known colors or nationalities. So it could only go in center.  After that the puzzle was much easier than I had expected. The order in which the clues can be used is not immediately obvious. When I first tried to solve it I was not using the clues properly and I thought that I would have to try many different layouts. The pieces of paper made it a lot easier to see what was happening. I had to cycle through the clues to find the one that wasn’t ambiguous. So maybe the clue records would need a counter to check for multiple possibilities and skip it.

I think if I was going to try to code this I might use an array[1..5] of records for results.
The relationship between records in different columns is sort of tricky I guess logic would need to be added somehow .

In some cases like pet fox it only said next to but not which side. I’d have to think about that
« Last Edit: February 04, 2025, 03:46:59 pm by Joanna from IRC »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

 

TinyPortal © 2005-2018