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