Created
March 15, 2016 14:53
-
-
Save KazuCocoa/1a0a1d712c2baecccad7 to your computer and use it in GitHub Desktop.
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 Znd do | |
@z "ズン" | |
@d "ドコ" | |
@k "キ・ヨ・シ" | |
def kiyoshi, do: [] |> kiy | |
defp kiy(zd) when zd == [@z, @z, @z, @z, @d], do: [zd|[@k]] |> Enum.join | |
defp kiy(zd) when length(zd) > 5, do: tl(zd) |> kiy | |
defp kiy(zd), do: [zd|[Enum.random([@z, @d])]] |> List.flatten |> kiy | |
end |
Author
KazuCocoa
commented
Mar 17, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment