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.53 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.52 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.51 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.50 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.49 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.48 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.47 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.46 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.45 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.44 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.43 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.42 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.41 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.40 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.39 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.38 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.37 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.36 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.35 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.34 tracks/perl6/exercises/anagram/example.yaml