From 11b189877da05d886793aa1319106beac8f71d85 Mon Sep 17 00:00:00 2001 From: Krzysztof Rudnicki Date: Sun, 4 Jun 2023 14:47:21 +0200 Subject: [PATCH] fix: correct less or equal syntax --- code/main.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/main.pl b/code/main.pl index 6383fdd5..0d8eb894 100644 --- a/code/main.pl +++ b/code/main.pl @@ -25,7 +25,7 @@ day_of_year(Date, DayOfYear) :- atom_chars(Month, MonthChars), month_days(Month, DaysInMonth, MonthDays), atom_number(Day, DayNumber), - ((DayNumber <= DaysInMonth, DayNumber > 0) -> DayOfYear is MonthDays + DayNumber) ; fail. + ((DayNumber =< DaysInMonth, DayNumber > 0) -> DayOfYear is MonthDays + DayNumber) ; fail. % interval(Date1, Date2) prints the number of days between Date1 and Date2 % We always expect date to be in format ddmm where 'd' stands for day and 'm' stands for month