This file contains hidden or 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
{ | |
"features": { | |
"copilot": false | |
}, | |
"theme": "One Light", | |
"buffer_font_size": 13, | |
"buffer_font_family": "MonoLisa Custom", | |
"tab_size": 2, | |
"language_overrides": { | |
"Elixir": { |
This file contains hidden or 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 SecretSanta do | |
@participants [:andrei, :dave, :john, :mary, :jane, :anna] | |
def get_random, do: generate_pairs() |> Enum.random() | |
defp generate_pairs(givers \\ @participants, receivers \\ @participants, existing_pairs \\ []) | |
defp generate_pairs([giver | givers], receivers, existing_pairs) do | |
for receiver <- receivers, | |
valid_pair?(giver, receiver, existing_pairs), |
OlderNewer