Not logged in. · Lost password · Register

Member for 2 months
54 posts
Subject: Problem 5, map coloring, availablecolors, etc.
I think I managed to fix the situation with the notebook. There may or may not be a bug in availablecolors (apart from the fact that it does the opposite of what it says). It works for me now on some tests. If it does not work for you, please let me know just how it crashes, best here in the forum.

If you run the sample paint query on a clean setup, you should get
ColoredMap = [sa:red, tas:red, vic:red, nsw:red, qld:red, nt:red, wa:red]
This post was edited on 2019-11-28, 17:54 by katjab.
Member since Oct 2016
6 posts
In there is a missing semicolon, isn't it?

arrangecolors([Country:Neighbors|Rest], ColorList, TempList, ColoredMap) :-
%    Tracing:
%    write('Color:'), write(Color),write(' TempList:'), write(TempList),nl,
    different(Color,Neighbors,TempList) <- here
    arrangecolors(Rest,ColorList,[Country:Color|TempList], ColoredMap).
Member since Oct 2016
6 posts
In reply to post #1
We already submitted a working solution with the original code.
Do you want us to find another one with the updated code?

sortedcountries(Countries,TempList,SortedCountries) :-
    % write(SortedCountriesWithConstraints), nl,
Member for 2 months
54 posts
arrangecolors is in the Edit section, which is the one you were supposed to fix.
As for sortedcountries, either is ok.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Datenschutz | Kontakt
Powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2011 by Yves Goergen