Initial upload

This commit is contained in:
halfdan committed 2022-08-24 14:28:45 +02:00
1 parent c67653ddee
commit 57bc7b0289
370 files changed
+18479

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
defmodule TakeANumber do
def start() do
spawn(fn -> loop(0) end)
end
defp loop(state) do
receive do
{:report_state, sender_pid} ->
send(sender_pid, state)
loop(state)
{:take_a_number, sender_pid} ->
state = state + 1
send(sender_pid, state)
loop(state)
:stop ->
nil
_ ->
loop(state)
end
end
end