Sha256: b5d10e52cfb75bf7b858d65c3fcad72e246069336fc93edba4205cf603b3a7b1

Contents?: true

Size: 326 Bytes

Versions: 47

Compression:

Stored size: 326 Bytes

Contents

# Declare package 'Leap' with version
package Leap 3;
use strict;
use warnings;
use Exporter 'import';
our @EXPORT_OK = qw(is_leap);

sub is_leap {
  my $year = shift;
  divisible_by($year, 400)
    or divisible_by($year, 4) and !divisible_by($year, 100)
    ? 1 : 0;
}

sub divisible_by {
  $_[0] % $_[1] == 0 ? 1 : 0;
}

1;

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
trackler-2.2.1.179 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.178 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.177 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.176 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.175 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.174 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.173 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.172 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.171 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.170 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.169 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.167 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.166 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.165 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.164 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.163 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.162 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.161 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.160 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.159 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm