-module(pyramid). -export([main/1]). main([N])-> push(list_to_integer(atom_to_list(N)),[]). push(0,_)->0; push(1,L)->io:format("~s~n",[L ++ "*"]), pop(L ++ "*"); push(N,L)->io:format("~s~n",[L ++ "*"]), push(N - 1, L ++ "*"). pop("*")-> 0; pop([_|L])-> io:format("~s~n",[L]), pop(L).