Skip to content

Instantly share code, notes, and snippets.

@Joakineee
Created May 6, 2020 14:16
Show Gist options
  • Save Joakineee/a21e91458451e5c99177dcf69a1ca814 to your computer and use it in GitHub Desktop.
Save Joakineee/a21e91458451e5c99177dcf69a1ca814 to your computer and use it in GitHub Desktop.
My first Erlang program
-module(second).
-export([hypotenuse/2,perimeter/2,area/2]).
hypotenuse(X,Y) ->
math:sqrt(first:square(X) + first:square(Y)).
perimeter(X,Y) ->
X + Y + hypotenuse(X,Y).
area(X,Y) ->
first:area(X,Y,hypotenuse(X,Y)).
@elbrujohalcon
Copy link

Excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment