Create a gist now

Instantly share code, notes, and snippets.

@ztj /tryme.erl
Created Jun 14, 2011

What would you like to do?
Learning Erlang. Counting Pies.
loop(A, B, C, D) when B /= D ->
io:fwrite("~s~B~n", [A,B]),
loop(A, C(B), C, D);
loop(A, B, _, _) ->
io:fwrite("~s~B~n", [A, B]),
inc(B) -> B + 1.
main() -> loop("Pies: ", 10, fun inc/1, 20).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment