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.0.0 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.55 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.54 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.53 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.52 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.51 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.50 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.49 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.48 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.47 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.46 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.45 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.44 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.43 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.42 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.41 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.40 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.39 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.38 tracks/perl6/exercises/atbash-cipher/example.yaml
trackler-2.1.0.37 tracks/perl6/exercises/atbash-cipher/example.yaml