Skip to content

Instantly share code, notes, and snippets.

View muhammednagy's full-sized avatar
😎
Working

Nagy Salem muhammednagy

😎
Working
View GitHub Profile
@muhammednagy
muhammednagy / fun.erl
Last active February 24, 2017 17:54
variables and patterns in erlang
-module(fun).
-export([maxThree/3,howManyEqual/3]).
maxThree(A,B,C) ->
Z = max(A,B),
max(Z,C).
howManyEqual(A,A,_) ->
2;
@pfiled
pfiled / mathStuff.erl
Created January 18, 2012 03:27
week 1 erlang
-module(mathStuff).
-export([perimeter/1]).
perimeter({square,Side}) ->
4 * Side;
perimeter({circle,Radius}) ->
2 * 3.1415926 * Radius;
perimeter({triangle,A,B,C}) ->
A + B + C;
perimeter({polygon,L}) ->