-
-
Save AlchemistCamp/564b1925d878ac422cdd15449f45fc13 to your computer and use it in GitHub Desktop.
Challenge 1 source
This file contains 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 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 |
This file contains 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 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