Skip to content

Instantly share code, notes, and snippets.

View rwngallego's full-sized avatar
🔥

Rowinson Gallego rwngallego

🔥
View GitHub Profile
@rwngallego
rwngallego / test_all_together.erl
Last active March 9, 2017 06:10
Testing the all_together.erl file
%%%%%% Testing %%%%%%
% Copy and paste the following content into the erl console
Circle = {circle, 45}.
Rectangle = {rectangle, 5, 7}.
RightTriangle = {right_triangle, 3, 4, 5}.
all_together:perimeter(Circle).
all_together:perimeter(Rectangle).
all_together:perimeter(RightTriangle).
all_together:area(Circle).
@rwngallego
rwngallego / all_together.erl
Created March 9, 2017 06:12
This is the final assessment for the first week - Functional Erlang. Testing: https://gist.github.com/rwngallego/1a516188a3542dd5ec46c855c89ef0e5
% Functional programming Erlang 1 - Assignment
%
% Author: Rowinson G.
% For testing use this gist: https://gist.github.com/rwngallego/1a516188a3542dd5ec46c855c89ef0e5
-module(all_together).
-export([perimeter/1, area/1, enclose/1, bits/1, bits_tail/1]).
%%%%%% Shapes %%%%%%%
-module(lists_module).
-export([product/1, maximum/1, product_t/1, maximum_t/1]).
% direct
product([]) ->
1;
product([H|T]) ->
H*product(T).