Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,10 @@
leap_year(L) :-
partition(is_leap_year, L, LIn, LOut),
format('leap years : ~w~n', [LIn]),
format('not leap years : ~w~n', [LOut]).
is_leap_year(Year) :-
R4 is Year mod 4,
R100 is Year mod 100,
R400 is Year mod 400,
( (R4 = 0, R100 \= 0); R400 = 0).

View file

@ -0,0 +1,4 @@
?- leap_year([1900,1994,1996,1997,2000 ]).
leap years : [1996,2000]
not leap years : [1900,1994,1997]
L = [1900,1994,1996,1997,2000].

View file

@ -0,0 +1,2 @@
?- findall(Y, (between(1990,2030,Y),day_of_the_year(date(Y,12,31),366)), L).
L = [1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028].