Toggle navigation
?
users online
Logout
Open hangout
Open chat for current file
% (c) 2014 23.4. % DD = 13'13 melankolio(DD):-length(AD,DD),ad(AD,2'1), a(AD,3'2,2'11,11'11,A),a(A,4'12,10'10,2'1, D), a(D, 2'1,13'13,2'11,DA),da(DA),!. ad( [],_). ad( [A|AD],A):-DA is A+11'1, ad( AD, DA ). a( AD, A,D ,DD ,DA):- d( AD, A,D ,AA), ADA is A+DD ,(D+ DD > 22'AD -16'DA +1 -> DAD is D-DD; DAD is D+DD), d(AA, ADA , DAD, DA). d([ ],_ ,_,[]). d([A |AD ],A,D,[D|DA]):- d(AD, A,D,DA). d([D|AD],A,D,[A|DA]):- d(AD,A,D,DA). d([AA|AD],A,D,[AA|DA]):- A\=AA,D\=AA,d(AD,A,D,DA). da([]). da([A,AD,DD,D|DA]) :-writeln([A,AD,DD,D]), da( DA). /** <examples> ?- melankolio(13'13). */