2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,8 +1,8 @@
|
|||
defmodule RC do
|
||||
def sparkline(str) do
|
||||
values = str |> String.split(~r/(,| )+/)
|
||||
|> Enum.map(&(elem(Float.parse(&1), 0)))
|
||||
{min, max} = {Enum.min(values), Enum.max(values)}
|
||||
|> Enum.map(&elem(Float.parse(&1), 0))
|
||||
{min, max} = Enum.min_max(values)
|
||||
IO.puts Enum.map(values, &(round((&1 - min) / (max - min) * 7 + 0x2581)))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue