yorlang icon indicating copy to clipboard operation
yorlang copied to clipboard

Max min branch

Open Harjacober opened this issue 5 years ago • 6 comments

Adds Maximum and Minimum helper functions

o_kere_julo(Minimum)

o_kere_julo returns the minimum number in a list of numbers

o_tobi_julo(Maximum)

o_tobi_julo returns the maximum number in a list of numbers

both functions takes an array or numbers separated by a ',' as argument if the first argument is an array, the function automatically ignores the other arguments and computes the max or min number in the first argument array.

Usage

var max = o_tobi_julo(34, 22, 56, 24, 4)
max = 56
var min= o_kere_julo(34, 22, 56, 24, 4)
min= 4
var min= o_kere_julo([34, 22, 56, 24, 4])
min= 4
var max= o_kere_julo([34, 22, 56, 24, 4], 45, 545, 45, 445)
max= 56
all other arguments are ignored only the first array argument is recognized

Harjacober avatar Dec 19 '18 10:12 Harjacober

it should be note that var in the code snippets will be replaced with jeki if to be used in Yorlang

Harjacober avatar Dec 19 '18 12:12 Harjacober

i thought variable declarations are done with jeki not var ?

Mastersam07 avatar Dec 19 '18 15:12 Mastersam07

it should be note that var in the code snippets will be replaced with jeki if to be used in Yorlang

okay.

Mastersam07 avatar Dec 19 '18 15:12 Mastersam07

Please add test cases for your code before i leave a review

anoniscoding avatar Dec 19 '18 15:12 anoniscoding

Hey @anoniscoding I followed the guidelines you gave above and updated the helperise eyiToKereJu and eyiToTobiJu and I deleted the file you asked me to. Kindly review again. Thanks

Harjacober avatar Jan 02 '19 09:01 Harjacober

I optimized the functions, I added more test cases as you requested and I registered the two helper functions at registeredHelperise.js which is now causing conflict. Kindly review again. Thanks

Harjacober avatar Jan 03 '19 21:01 Harjacober