PROLOG LANGUAGE: Map will include the states of Arkansas, Louisiana, Tennessee, Mississippi, & Alabama. The map maker

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

PROLOG LANGUAGE: Map will include the states of Arkansas, Louisiana, Tennessee, Mississippi, & Alabama. The map maker

Post by answerhappygod »

PROLOG LANGUAGE:
Map will include the states of Arkansas, Louisiana, Tennessee,Mississippi, & Alabama. The map maker only has 3 colors to use and no two states whichshare a border can be colored the same color. Write a programwhich finds an acceptable assignment of colors to states. Write a Prolog program states/5 which findsan acceptable assignment of colors to the 5 states above stateswithout using a graph as the underlying data structure.
Test file::- nl, write('States: ').:- states(TN,MS,AL,LA,AR), write(['TN', TN, ' MS', MS, ' AL', AL, ' LA',LA, ' AR', AR]), nl.
DO NOT SEND ME THIS INCORRECT CODE. THIS IS A COMPLETESHIT.love_compatible(X, Y) :- likes(X, Y), likes(Y, X).X = Arkansas,Y = LouisianaX = Arkansas,Y = Louisiana ; /* typing semicolon causes Prolog to find the nextmatch */X = Arkansas,Y = Louisiana.likes(Tennessee,Mississippi).likes(Mississippi,Alabama).likes(Arkansas,Louisiana,).likes(Louisiana,Arkansas,).love_compatible(X, Y) :- likes(X, Y), likes (Y, X).germany(BW, BY) :- neighbor(BW, BY).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply