Skip to content

Commit

Permalink
Say hello in elixir 💧
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcsally committed Feb 12, 2020
1 parent b26f244 commit 550d856
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rust 1.41.0
elixir 1.10
erlang 22.2
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ The rules are:
- [ ] c++
- [x] css
- [ ] coffeescript
- [ ] elixir
- [x] elixir
- [ ] erlang
- [ ] java
- [x] javascript
- [x] python
Expand Down
16 changes: 16 additions & 0 deletions elixir/index.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
defmodule Main do
# with no input provided
def say_hello() do
name = "world"
IO.puts("hello, " <> name <> "!")
end

# with input provided
def say_hello(name) do
IO.puts("hello, " <> name <> "!")
end
end

# To run: elixirc ./elixir/index.exs
IO.puts(Main.say_hello("world"))
IO.puts(Main.say_hello())

0 comments on commit 550d856

Please sign in to comment.