Skip to content

Instantly share code, notes, and snippets.

@AlchemistCamp
Created June 26, 2018 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlchemistCamp/564b1925d878ac422cdd15449f45fc13 to your computer and use it in GitHub Desktop.
Save AlchemistCamp/564b1925d878ac422cdd15449f45fc13 to your computer and use it in GitHub Desktop.
Challenge 1 source
defmodule Greeter do
@author "Mark"
def start do
name = IO.gets("Hi there! What's your name?\n") |> String.trim
if name == @author do
"Wow! #{@author} is my favorite name. I was programmed by someone named #{@author}!"
else
"Hi, #{name}. It's nice to meet you."
end
end
end
defmodule Greeter do
def start do
name = IO.gets("Hi there! What's your name?\n")
case String.trim(name) do
"Mark" -> "Wow! Mark is my favorite name. I was programmed by someone named Mark!"
name -> "Hi, #{name}. It's nice to meet you."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment