Skip to content

Instantly share code, notes, and snippets.

View gupta82anish's full-sized avatar

Anish Gupta gupta82anish

  • Vinesia
  • Warsaw
  • 08:46 (UTC +02:00)
View GitHub Profile
@gupta82anish
gupta82anish / week2_assignment.erl
Last active May 13, 2020 08:51
Practice Assignment for Future Learn Functional Programming with Erlang Course.
-module(assignment).
-export([perimeter/1,area/1,bits/1,tests/0]).
%Perimeter functions for circle,rectangle, square
perimeter({circle, {_X,_Y}, R}) ->
2*math:pi()*R;
perimeter({rectangle,H,W}) ->
2*H + 2*W;
perimeter({square,L}) ->
math:pow(L,2);
16:01:50.795 [info] Application elixir_ls_utils exited: :stopped
[Info - 4:01:50 PM] Connection to server got closed. Server will restart.
Started ElixirLS Fork v0.3.2
16:01:50.796 [info] Application erl2ex exited: :stopped
16:01:50.796 [info] Application forms exited: :stopped
Elixir version: "1.10.2 (compiled with Erlang/OTP 21)"
Erlang version: "22"