Sha256: fc1eb4dceef71d34fd0521fd08dadf2c59b78289b5d224c34e2252a270aea499

Contents?: true

Size: 369 Bytes

Versions: 165

Compression:

Stored size: 369 Bytes

Contents

unit module GradeSchool:ver<1>;

class Roster is export {
  has %!roster;

  method add-student (Str:D :$name!, Int:D :$grade!) {
    %!roster.append($grade, $name);
  }

  method list-grade (Int:D $grade --> Seq:D) {
    %!roster{$grade}.sort;
  }

  method list-all {
    my @list.append("Grade $_", %!roster{$_}.sort) for %!roster.keys.sort;
    return @list;
  }
}

Version data entries

165 entries across 165 versions & 1 rubygems

Version Path
trackler-2.2.1.48 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.47 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.46 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.45 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.44 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.43 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.42 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.41 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.40 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.39 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.38 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.37 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.36 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.35 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.34 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.33 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.32 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.31 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.30 tracks/perl6/exercises/grade-school/Example.pm6
trackler-2.2.1.29 tracks/perl6/exercises/grade-school/Example.pm6