Sha256: 814f9d1aaadb2fdf1ed6a229d592714650bb79280e37fa1fd2016cd0fabfd2fa
Contents?: true
Size: 658 Bytes
Versions: 213
Compression:
Stored size: 658 Bytes
Contents
" " TravisCI's Trusty uses Vim 7.4.52. No uniq() for us. " function! Equilateral(triangle) abort let [a, b, c] = a:triangle return s:invalid(a:triangle) ? 0 : a == b && a == c endfunction function! Isosceles(triangle) abort let [a, b, c] = a:triangle return s:invalid(a:triangle) ? 0 : a == b || a == c || b == c endfunction function! Scalene(triangle) abort let [a, b, c] = a:triangle return s:invalid(a:triangle) ? 0 : a != b && a != c && b != c endfunction function! s:invalid(triangle) abort let [a, b, c] = a:triangle if a == 0 || b == 0 || c == 0 || a + b < c || a + c < b || b + c < a return 1 endif return 0 endfunction
Version data entries
213 entries across 213 versions & 1 rubygems