Some minor tweaks.
authorPete Elmore <pete@debu.gs>
Mon, 4 Apr 2016 23:01:51 +0000 (16:01 -0700)
committerPete Elmore <pete@debu.gs>
Mon, 4 Apr 2016 23:01:51 +0000 (16:01 -0700)
erlang/p002.erl
erlang/p003.erl
erlang/p031.erl
erlang/p102.erl

index 3932cb96e779d66667030837eab50c9693de3b9c..38a9352015e3f76572d720fe8a97bff751145878 100644 (file)
@@ -1,12 +1,6 @@
 % 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]).
 
@@ -25,4 +19,5 @@ seftil(N) ->
 
 main(_) ->
        io:write(seftil(4000000)),
-       io:fwrite("\n").
+       io:fwrite("\n"),
+       init:stop().
index b17799d77996081fff849d91cc7be56d7a3fb22d..3d9dffd61bad1ec7e2e2552be82adb0e9c6ba444 100644 (file)
@@ -22,14 +22,8 @@ largest_factor(N, F) when N rem F =:= 0 ->
        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().
index 18002656009f1e5ef958264245ba9260a5ecfaa1..2696b45d637af059555ce16611b145f53abbe901 100644 (file)
@@ -8,4 +8,5 @@ p([H|T], N) -> p(T, N) + p([H|T], N - H).
 
 main(_) ->
        io:write(p([200, 100, 50, 20, 10, 5, 2], 200)),
-       io:fwrite("\n").
+       io:fwrite("\n"),
+       init:stop().
index 520e194e188cccaac89ba66250564cbe0f867b50..fd7b572d7b051de274a3da9be0772894d72f5fb1 100644 (file)
@@ -117,4 +117,5 @@ main(_) ->
        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().