09/07/15 04:18:51
>>475
% Prolog
'Zellerの公式'(_年,1,_日,_曜日) :-
_前年 is _年 - 1,
'Zellerの公式'(_前年,13,_日,_曜日),!.
'Zellerの公式'(_年,2,_日,_曜日) :-
_前年 is _年 - 1,
'Zellerの公式'(_前年,14,_日,_曜日),!.
'Zellerの公式'(_年,_月,_日,_曜日) :-
_年=Y,_月=M,_日=D,
_曜日を表す値 is (Y + Y // 4 - Y // 100 + Y // 400 + ((( 13 * M ) + 8 ) // 5 ) + D ) mod 7,
曜日を表す値(_曜日を表す値,_曜日).
曜日を表す値(1,月曜).
曜日を表す値(2,火曜).
曜日を表す値(3,水曜).
曜日を表す値(4,木曜).
曜日を表す値(5,金曜).
曜日を表す値(6,土曜).
曜日を表す値(7,日曜).