Sha256: 4f463078dd684d5cdf2dc99557842d4517a52a42c2b58e191b96b5926c51d8cd

Contents?: true

Size: 542 Bytes

Versions: 82

Compression:

Stored size: 542 Bytes

Contents

exercise: Anagram
version: 1
plan: 18
imports: '&match-anagrams'
tests: |
  is match-anagrams(|.<subject candidates>), |.<expected description> for @($c-data<cases>);

unit: module
example: |
  sub match-anagrams ($word, @words) is export {
    my @results;
    my $canonical = canonize($word);
    for @words -> $w {
      next if $w.lc eq $word.lc;
      my $try = canonize($w);
      if $try eq $canonical {
        @results.push: $w;
      }
    }
    @results;
  }
  
  sub canonize ($str) {
    (($str.lc.split('')).sort).join('');
  }

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
trackler-2.2.0.0 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.55 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.54 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.53 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.52 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.51 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.50 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.49 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.48 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.47 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.46 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.45 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.44 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.43 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.42 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.41 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.40 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.39 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.38 tracks/perl6/exercises/anagram/example.yaml
trackler-2.1.0.37 tracks/perl6/exercises/anagram/example.yaml