117 questions
0 votes
0 answers
116 views
how can i solve the prolog puzzle below?
Quiz Quest: There has been a keenly fought quiz among five teams. The losers did not quite live up to their name and finish fourth. The numbskulls were not the team who took movies as a special ...
0 votes
0 answers
69 views
Prolog code won't complete due to computational bug
I'll preface this with the prompt I have to follow: Bobby went to Truman Theaters. Taking a quick glance around, he can see that a different movie is playing on each screen (1 through 10) and that ...
0 votes
0 answers
97 views
Improper Prolog logic for logic test
Below is a Prolog problem in my textbook that is a variation of the Zebra problem. Instead of the original, it asks you to find the location of the pizza out of 4 people who each ordered a unique food ...
0 votes
0 answers
81 views
Prolog Shark Nationality
I need to solve this problem with a Prolog code in SWISH: " In a quiet street located in a galaxy far, far away, there are five houses, each of a different color. In each house lives a person of ...
1 vote
1 answer
149 views
Why is this prolog function running indefinitely, how do I fix it?
I am trying to create a prolog predicate to solve this zebra problem however It keeps on running indefinitely and does not produce a result, how can I fix this. Here is the Zebra Problem: The five ...
0 votes
2 answers
356 views
Using Prolog to solve The Jindosh Riddle from Dishonored 2
I am playing the game Dishonored 2 There is a puzzle in the game, see the picture below (no spoilers). Riddle Naturally I wanted to solve this using Prolog. I have looked around and other people have ...
1 vote
3 answers
295 views
Solving a logic task using Prolog
I started to learn Prolog and I can't solve a difficult task for me. On Halloween, three friends - Bob, Mark, Alex, chose the costumes of three ghosts: a ghost, a zombie, a werewolf. It is known that: ...
0 votes
1 answer
49 views
I cannot sort variables according to their given numbers (zebra problem)
` import itertools def imright(h1, h2): "House h1 is immediately right of h2 if h1-h2 == 1." return h1-h2 == 1 def nextto(h1, h2): "Two houses are next to each other if ...
1 vote
3 answers
340 views
Prolog - animal puzzle, need to force each atom to be used only once
I've seen a few posts on SO discussing this puzzle, but they seem to be aimed at fast execution and I don't really understand what's going on. I'm trying to keep it very simple and want to write ...
-1 votes
1 answer
140 views
BigQuery calculation to count how many unique combinations of 4 items there are across 6 columns
I have the following table (I have covered up the current_holder column for privacy reasons): For each row, I want to find the number of times we could pull 4 unique objects out of a bag (the objects ...
0 votes
2 answers
221 views
Prolog logic task
the rules are five students won five different places in five different disciplines - Alex, Bob, John, Deo, Sam. The language student placed higher than Bob as much as Bob placed higher than the law ...
1 vote
2 answers
213 views
How to solve and how to use negation in this Prolog puzzle?
I want to solve this logic puzzle with Prolog without using any built-in functions or libraries. The problem is I don't know how to formulate the negative terms in the code. The negative terms are in ...
0 votes
1 answer
53 views
Can't figure out how to get logical answer I'm looking for in Prolog
I'm trying to learn swi-prolog and I'm struggling with the following question. The question goes: Vanessa, Mary and Penny study chemistry, biology and math, in countries Spain, Portugal, Venezuela. It ...
3 votes
1 answer
182 views
Prolog Room Adjacency Puzzle
I am working on an assignment and I have to write a prolog program to solve a puzzle where there are 5 rooms and there are five people, Hunter, Laura, Arnie, Addiley and Ramey. Hunter cannot be in ...
0 votes
0 answers
82 views
Logical task about children
A family has 5 children. Their ages: 4, 5, 6, 7 and 8 years old. Their names: Rose, Becca, Iona, Stu, Rob. Each of them has a talent: piano, math, violin, literature, computer. I need to find out each ...