diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-01-31 18:28:10 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-01-31 18:28:10 +0000 |
| commit | 16962e1836251526fa08895b1a76dd72b7fd5ef9 (patch) | |
| tree | ef60d08e792825407d41fb77c14c26ecb135e2fc /lib/util.moon | |
| parent | nested parens in comments (diff) | |
| download | alive-16962e1836251526fa08895b1a76dd72b7fd5ef9.tar.gz alive-16962e1836251526fa08895b1a76dd72b7fd5ef9.zip | |
modularize
Diffstat (limited to 'lib/util.moon')
| -rw-r--r-- | lib/util.moon | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/util.moon b/lib/util.moon new file mode 100644 index 0000000..7306fbc --- /dev/null +++ b/lib/util.moon @@ -0,0 +1,13 @@ +import Op from require 'base' + +class pick extends Op + setup: (@i, ...) => + @choices = { ... } + + update: => + i = 1 + (math.floor @i\get!) % #@choices + @value = @choices[i]\get! + +{ + :pick +} |
