Line 122: |
Line 122: |
| end | | end |
| return maxValue | | return maxValue |
| + | end |
| + | |
| + | function Utils.imin(arr) |
| + | local minValue |
| + | local minIndex |
| + | for i, v in ipairs(arr) do |
| + | if not minValue or v < minValue then |
| + | minValue = v |
| + | minIndex = i |
| + | end |
| + | end |
| + | return minValue |
| end | | end |
| | | |