diff options
| author | chirvasitua <chirvasitua@gmail.com> | 2021-07-13 16:24:44 -0400 |
|---|---|---|
| committer | chirvasitua <chirvasitua@gmail.com> | 2021-07-13 16:24:44 -0400 |
| commit | ec4612725627818fe65d62781360685349c6da11 (patch) | |
| tree | cc803d347b8fc28dddbe747be86241eef08159d2 /challenge-080/stuart-little/lua/ch-2.lua | |
| parent | d00ce4c9c3d962d3a60e515f455e271bae7e5bd4 (diff) | |
| download | perlweeklychallenge-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-x | challenge-080/stuart-little/lua/ch-2.lua | 9 |
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) |
