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.1.13 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.12 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.11 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.10 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.9 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.8 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.7 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.6 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.5 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.4 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.3 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.2 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.1 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.0 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.0.6 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.0.5 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.0.4 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.0.3 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.0.2 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.0.1 tracks/perl6/exercises/anagram/example.yaml