Sha256: 2fa032242c6d9927558d4e6d52449c74dbf2f378661ba3867c0384926fdddfd9

Contents?: true

Size: 275 Bytes

Versions: 185

Compression:

Stored size: 275 Bytes

Contents

object Atbash {
  private def substitute(c: Char) =
    if (c.isDigit) c.toString
    else if (c.isLetter) ('a' + ('z' - c.toLower)).toChar.toString
    else ""

  def encode(s: String): String =
    s.foldLeft("")((acc, c) => acc + substitute(c)).grouped(5).mkString(" ")
}

Version data entries

185 entries across 185 versions & 1 rubygems

Version Path
trackler-2.1.0.47 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.46 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.45 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.44 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.43 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.42 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.41 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.40 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.39 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.38 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.37 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.36 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.34 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.33 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.32 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.31 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.30 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.29 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.28 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.27 tracks/scala/exercises/atbash-cipher/example.scala