Skip to content

Instantly share code, notes, and snippets.

@xavvvier
Created October 30, 2015 21:20
Show Gist options
  • Save xavvvier/585e3b8c9a0dce5c8ea0 to your computer and use it in GitHub Desktop.
Save xavvvier/585e3b8c9a0dce5c8ea0 to your computer and use it in GitHub Desktop.
def column_winner?(_, _, _, 4) do
true
end
def column_winner?(_, 1, _, _) do
false
end
def column_winner?(player, row, col, count) do
neighbor = agent_name(row-1,col)
|> Process.whereis
|> Agent.get(&(&1))
if neighbor == player do
column_winner?(player, row-1, col, count+1)
else
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment