Range() functions

About Monkey 2 Forums Monkey 2 Code Library Range() functions

This topic contains 2 replies, has 1 voice, and was last updated by  nerobot 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #13754


    Set of functions to generate ranges of numbers and chars.

    Easy to extending for other numeric types (make it generic for example).

    Also there is a helper function Join() that join array values into single string with delimeters.

    Functions and demo app (2 in 1):

    It prints

    Maybe it can be part of std module.



    A few new kinds of Range is here. 🙂

    They generate by expression, where single values or ranges are separated by commas,

    and ranges min-max diapasons separated by minus-sign.

    RangeExprInt – generates sequence of integers , for example: expr=”1,14,20-27″

    RangeExprChars – generates sequence of chars, for example: expr=”a-z,A-Z,0-9″

    Also there is a Stack extension with method Merge that allow you to merge values into stack to have unique values only.



    Additional arrays helpers:

    ArrayPad() – Returns a copy of the array padded to size specified by size with value ‘value’.

    ArrayFill() – Fills an array with ‘count’ entries of the ‘value’.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.