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.2.1.4 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.1.3 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.1.2 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.1.1 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.1.0 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.0.6 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.0.5 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.0.4 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.0.3 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.0.2 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.0.1 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.2.0.0 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.55 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.54 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.53 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.52 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.51 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.50 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.49 tracks/scala/exercises/atbash-cipher/example.scala
trackler-2.1.0.48 tracks/scala/exercises/atbash-cipher/example.scala