Sha256: 9c2dcadac07b4498958709f545e1f7e07cf6df5af6b7f5135eb2d3544ef21bd4

Contents?: true

Size: 676 Bytes

Versions: 82

Compression:

Stored size: 676 Bytes

Contents

exercise: AtbashCipher
version: 1
plan: 4
imports: '&encode &decode'
tests: |
  for @($c-data<cases>) {
    my $test = .<description> ~~ 'encode' ?? 'encode' !! 'decode';
    subtest $test => {
      my @cases = |.<cases>;
      plan +@cases;
      is &::($test)(.<phrase>), |.<expected description> for @cases;
    }
  }

unit: module
example: |
  sub encode($input) is export {
      decode($input.lc.trans( ['a'..'z', 0..9] => '', :complement ) )
          .comb(5)
          .join: ' ';
  }
  
  sub decode (Str $input) is export {
      return $input
              .lc
              .subst( /\W/, '', :g )
              .trans( [ 'a'..'z' ] =>  ['a'..'z'].reverse );
  }

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
trackler-2.2.1.33 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.32 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.31 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.30 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.29 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.28 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.27 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.26 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.25 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.24 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.23 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.22 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.21 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.20 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.19 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.18 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.17 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.16 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.15 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.2.1.14 tracks/perl6/exercises/atbash-cipher/example.yaml