Sha256: ead483ca3b16061b4e2ebe5512587c8e643a59b84a00750aa86db38cd318eccb

Contents?: true

Size: 273 Bytes

Versions: 145

Compression:

Stored size: 273 Bytes

Contents

# Declare package 'Leap' with version
package Leap 2;
use strict;
use warnings;

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

145 entries across 145 versions & 1 rubygems

Version Path
trackler-2.2.1.131 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.130 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.129 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.128 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.127 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.126 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.125 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.124 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.123 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.122 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.121 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.120 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.119 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.118 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.117 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.116 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.115 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.114 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.113 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.111 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm