Here is another example using as a Module and using pattern matching. It looks hilarious :P
defmoduleFizzBuzzdodefrun(num)whennum>=1andnum<=100do:fizzbuzz(num,rem(n,3),rem(n,5))run(num-1)enddefrun(0),do:{:ok,"Done"}defrun(_)do:{:error,"Something went wrong"}defpfizzbuzz(_,0,0),do:IO.puts"Fizzbuzz"defpfizzbuzz(_,0,_),do:IO.puts"Fizz"defpfizzbuzz(_,_,0),do:IO.puts"Buzz"defpfizzbuzz(n,_,_),do:n|>to_string|>IO.putsend# ExampleFizzBuzz.run(55)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Elixir
Ooh, this would make a nice addition to the repo.
Go ahead.
Here is another example using as a Module and using pattern matching. It looks hilarious :P