![]() ![]() Row(_, 6, parrot)], % The owner of the parrot lives on floor 6. Row(_, 5, cat), % The cat owner lives on floor 5. Row(_, 4, fish), % The owner of the fish lives on floor 4. Row(_, 3, hamster), % The hamster owner lives on floor 3. Row(_, 2, dog), % The dog owner lives on floor 2. Row(_, 1, snake), % The snake owner lives on floor 1. Table = [row(_, 0, canary), % The canary owner lives on floor 0. My solution looks like this: puzzle(Table) :. I have idea to create two tables with animals and number of floors and then by select check all sentences but I dont know how to crate predicate to check if owner of any animal lives on given floor. The owner of the parrot lives on floor 6. In which floort each of them lives and what kind of animal does it have when bellow sentences are true?įranek lives lower than Albert. They live in one building, each on a different level (0, 1, 2, …).ĭog, a cat, a fish, hamster, parrot, snake, canary. Friends: Jarek, Frank, Stefanie, Albert, Simon, Robert, Marcin ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |