/ Published in: Clojure
Expand |
Embed | Plain Text
% Erlang % wearetherock# erlc zeez2.erl % wearetherock# erl -noshell -s zeez2 main 10 -module(zeez2). -export([main/1]). main([A]) -> L = list_to_integer(atom_to_list(A)), zeez( true ,L, L). zeez(true, 0, N) -> io:format("~p~n", [zeez(z, N)]), init:stop(); zeez(false, M, N) -> io:format("~p~n", [zeez(space, M)]), zeez(M-1 rem N =:= 0, M-1, N ); zeez(true, M, N) -> io:format("~p~n", [zeez(z, M)]), zeez(M-1 rem N =:= 0, M-1 , N ). zeez(space, 0) -> "Z"; zeez(space, N) -> " " ++ zeez(space, N-1); zeez(z,0) -> "Z"; zeez(z, N) -> "Z" ++ zeez(z, N-1).
You need to login to post a comment.
