Ok I fixed my first issue and it now correctly iterates through each song and also passes in the correct file sizes.
Here is the Updated Method.
% Recursive algorithm
burnCD( SizeOfCD, [Item|Rest], [Item|NewList] ) :-
song( Item, _, Size ),
burnCD( SizeOfCD - Size, Rest, NewList ),
burnCD(...
I am not looking for the answer, only a direction to take this assignment. I need to find the max rating of a list of songs that will fit on a given cd size.
example:
song rating filesize
Song1 5 600
Song2 4 200
Song3 2 400
If I had 400 space on...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.