anoniscoding / yorlang

A programming language with yoruba language construct
https://anoniscoding.github.io/yorlang/
MIT License
450 stars 70 forks source link

Max min branch #51

Open Harjacober opened 5 years ago

Harjacober commented 5 years ago

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 commented 5 years ago

it should be note that varin the code snippets will be replaced with jekiif to be used in Yorlang

Mastersam07 commented 5 years ago

i thought variable declarations are done with jeki not var ?

Mastersam07 commented 5 years ago

it should be note that varin the code snippets will be replaced with jekiif to be used in Yorlang

okay.

anoniscoding commented 5 years ago

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

Harjacober commented 5 years ago

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

Harjacober commented 5 years ago

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