Hi, I have written a small programm which shows a cd' s artist, released album, year, etc which is in this way:
cd(album(band(‘Coldplay’), name(‘Viva la Vida or Death and All His Friends’)), release(year(2008), uschart(1)), genre(‘Alternative rock’), price(new(25), used(18))).
This argument(cd) is repeated also for other arguments.
What I have to make is, the argument album_year(Album,Year) that succeeds when the Album has sold out the year 'Year'.
For example, ?- album_year(X,2003).
X = album('Coldplay', (‘Viva la Vida or Death and All His Friends’)
Of course in my programm it will show the 'band' and 'name' as well.
What I wrote is:
album_year(Album,Year) :- cd(Album(Band,Name),Release(Year1,Uschart), Genre, Price(New,Used)), Year is Year1.
but it doesn't work.
Also, we have to make the argument:
similar_album(Album1,Album2),
which succeeds when the two albums have the same genre. Thanks
cd(album(band(‘Coldplay’), name(‘Viva la Vida or Death and All His Friends’)), release(year(2008), uschart(1)), genre(‘Alternative rock’), price(new(25), used(18))).
This argument(cd) is repeated also for other arguments.
What I have to make is, the argument album_year(Album,Year) that succeeds when the Album has sold out the year 'Year'.
For example, ?- album_year(X,2003).
X = album('Coldplay', (‘Viva la Vida or Death and All His Friends’)
Of course in my programm it will show the 'band' and 'name' as well.
What I wrote is:
album_year(Album,Year) :- cd(Album(Band,Name),Release(Year1,Uschart), Genre, Price(New,Used)), Year is Year1.
but it doesn't work.
Also, we have to make the argument:
similar_album(Album1,Album2),
which succeeds when the two albums have the same genre. Thanks