Add to int array with ruby; how?
Posted: Sun Mar 04, 2018 2:40 pm
Hi all. A ruby question:
Seems like we have to use ruby to add each int value in a int array with a fixed number, because there is no "add to int array" primitive. lets say I have A given array like
3
4
2
3
and I would like to add 2 to each value and end up with
5
6
4
5
How it done with ruby, by using 2 inputs (one input for the array and one for the int value that added to each value in the array) and one int array output for the results?
Seems like we have to use ruby to add each int value in a int array with a fixed number, because there is no "add to int array" primitive. lets say I have A given array like
3
4
2
3
and I would like to add 2 to each value and end up with
5
6
4
5
How it done with ruby, by using 2 inputs (one input for the array and one for the int value that added to each value in the array) and one int array output for the results?