summaryrefslogtreecommitdiff
path: root/erlang/words.erl
diff options
context:
space:
mode:
Diffstat (limited to 'erlang/words.erl')
-rw-r--r--erlang/words.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/erlang/words.erl b/erlang/words.erl
new file mode 100644
index 0000000..4eb0354
--- /dev/null
+++ b/erlang/words.erl
@@ -0,0 +1,6 @@
+-module(words).
+-export([words/1]).
+
+words([]) -> 1;
+words([32|Tail]) -> 1 + words(Tail);
+words([_|Tail]) -> words(Tail).