Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 1.78 KB

README.md

File metadata and controls

54 lines (34 loc) · 1.78 KB

Programming In Prolog (My sandbox)

Lecture notes

These lecture notes are based on the awsome 4 part video about Prolog from The Simple Engineer - Prolog Programming

Other articles from internet

I copied them here because of Markdown`s beautiful formatting. Credits goes to the authors

Logic Problems & their solutions in Prolog

The Criminal

A says: "It's not me"
B says: "It's D"
C says: "It's B"
D says: "It's not me

There is only one criminal and the rest are telling the truth.
Find who the criminal is. 

Solution

The Graph coloring problem

Given a map divided into regions, can you color the map using a defined amount of colors such that no two adjacent regions have the same color? In the image below, we start with the left map, uncolored, and try to find a map coloring using only four different colors. The right map is one of the possible solutions. You can read more about how the solution is written here: Source Image

Solution

Query

germany(SH, MV, HH, HB, NI, ST, BE, BB, SN, NW, HE, TH, RP, SL, BW, BY).

Resourses: