From 2dc8ef9b84a1b6724ae22ecf290b73190c1aa695 Mon Sep 17 00:00:00 2001 From: Fourand <4randrofficial@gmail.com> Date: Thu, 17 Oct 2019 23:36:47 +0500 Subject: add ch-1.pl --- challenge-030/vyacheslav-volgarev/perl5/ch-1.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 challenge-030/vyacheslav-volgarev/perl5/ch-1.pl diff --git a/challenge-030/vyacheslav-volgarev/perl5/ch-1.pl b/challenge-030/vyacheslav-volgarev/perl5/ch-1.pl new file mode 100644 index 0000000000..c677a4a685 --- /dev/null +++ b/challenge-030/vyacheslav-volgarev/perl5/ch-1.pl @@ -0,0 +1,14 @@ +use strict; +use warnings; +use v5.10; + +use constant { + Sunday => 0, + Wednesday => 3 +}; + +my $day = Wednesday; + +for ( 2020.. 2100 ) { + say "25 Dec $_ is Sunday" if ( $day += $_ % 4 != 0 || ($_ % 100 == 0 && $_ % 400 != 0) ? 1 : 2 ) % 7 == Sunday; +} -- cgit