Skip to content

Instantly share code, notes, and snippets.

@kirisaki
kirisaki / mission2.ex
Created February 20, 2018 01:49
Gumimaze Solution
defmodule Gumimaze do
def read() do
lines = "maze.txt" |> File.read!() |> String.trim() |> String.split("\n")
for {line, y} <- Enum.with_index(lines), {c, x} <- Enum.with_index(String.to_charlist(line)), into: %{} do
{{x, y}, c}
end
end
def solve(maze) do
{x, y} = elem(Enum.find(maze, fn {_, v} -> v == ?S end), 0)
@voluntas
voluntas / rebar3.rst
Last active July 24, 2016 02:55
rebar3 コトハジメ