Mix.install([
{:nimble_parsec, "~> 1.0"}
])
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule CeasarCipher do | |
@lower Enum.to_list(?a..?z) | |
@upper Enum.to_list(?A..?Z) | |
defp map_within_range(c, range, shift) do | |
if c in range do | |
range | |
|> Stream.cycle() | |
|> Stream.drop(shift + (c - hd(range))) | |
|> Stream.take(1) |
OlderNewer