urduscript
urduscript copied to clipboard
Added naqsh function representing the map function
I have added the naqsh function which maps a number from one range to another
naqsh(value, currentMinRange, currentMaxRange, targetMinRange, targetMaxRange)
Example:
rakho x = naqsh(5,1,10,1,100)
likho(x) // outputs 45
can you provide little elaboration over this ? or some thing equivalent in JS, may be I am missing something here. Thanks
It's just a mathematical function, https://www.youtube.com/watch?v=nicMAoW6u1g https://stackoverflow.com/questions/345187/math-mapping-numbers https://stackoverflow.com/questions/5649803/remap-or-map-function-in-javascript
This is great stuff. I know naksh
translates perfectly but do we have a more simpler word we can use? Not necessarily a translation but conveys the meaning.
Yes @asadm i agree, its a bit complicated since its a math driven function but I couldn't think of a simpler interpretation. Nevertheless, suggestions from the community would be highly appreciated so that we can change it to a simpler one.
This would begin to change urduscript from a javascript dialect to a javascript library; is that consistent with the goals?
I think primitive helper functions align with the goal fine. The goal is to make programming easier for Urdu speakers. Even if we go beyond what JS offers.
I would imagine inheriting some AJAX helpers too.
So have we decided a name for the function?