% Find the sum of all the even-valued terms in the Fibonacci sequence which do
% not exceed four million.
-% I do not know how to properly express myself in this language. Expect
-% horrors.
-
-% Also, I'd like to thank the Erlang designer(s) for using a terrible comment
-% character.
-
-module(p002).
-export([seftil/1, main/1]).
main(_) ->
io:write(seftil(4000000)),
- io:fwrite("\n").
+ io:fwrite("\n"),
+ init:stop().
largest_factor(N div F, F);
largest_factor(N, F) ->
largest_factor(N, F + 2).
-% I'M NEW TO ERLANG!
-%
-% ...
-%
-% ...
-%
-% Good night, everybody.
main(_) ->
io:write(largest_factor(600851475143)),
- io:fwrite("\n").
+ io:fwrite("\n"),
+ init:stop().
main(_) ->
io:write(p([200, 100, 50, 20, 10, 5, 2], 200)),
- io:fwrite("\n").
+ io:fwrite("\n"),
+ init:stop().
Checker = spawn_checker(Collector),
Parser = spawn_parser(Checker),
spawn_reader(Parser),
- receive N -> io:format("~p\n", [N]) end.
+ receive N -> io:format("~p\n", [N]) end,
+ init:stop().