aboutsummaryrefslogtreecommitdiff
path: root/challenge-080/stuart-little/lua/ch-2.lua
diff options
context:
space:
mode:
authorchirvasitua <chirvasitua@gmail.com>2021-07-13 16:24:44 -0400
committerchirvasitua <chirvasitua@gmail.com>2021-07-13 16:24:44 -0400
commitec4612725627818fe65d62781360685349c6da11 (patch)
treecc803d347b8fc28dddbe747be86241eef08159d2 /challenge-080/stuart-little/lua/ch-2.lua
parentd00ce4c9c3d962d3a60e515f455e271bae7e5bd4 (diff)
downloadperlweeklychallenge-club-ec4612725627818fe65d62781360685349c6da11.tar.gz
perlweeklychallenge-club-ec4612725627818fe65d62781360685349c6da11.tar.bz2
perlweeklychallenge-club-ec4612725627818fe65d62781360685349c6da11.zip
1st commit on 080_lua
Diffstat (limited to 'challenge-080/stuart-little/lua/ch-2.lua')
-rwxr-xr-xchallenge-080/stuart-little/lua/ch-2.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/challenge-080/stuart-little/lua/ch-2.lua b/challenge-080/stuart-little/lua/ch-2.lua
new file mode 100755
index 0000000000..93bb3fbc08
--- /dev/null
+++ b/challenge-080/stuart-little/lua/ch-2.lua
@@ -0,0 +1,9 @@
+#!/usr/bin/env lua
+
+-- run <script> <space-separated numbers>
+
+local out=#arg
+for i=1,#arg-1 do
+ if arg[i] ~= arg[i+1] then out=out+1 end
+end
+print(out)