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.33 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.32 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.31 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.30 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.29 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.28 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.27 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.26 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.25 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.24 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.23 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.22 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.21 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.20 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.19 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.18 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.17 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.16 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.15 tracks/perl6/exercises/anagram/example.yaml
trackler-2.2.1.14 tracks/perl6/exercises/anagram/example.yaml