Lnum()

From TinyMUX
Jump to navigation Jump to search

Description

FUNCTION: 20px-Function.png lnum(number1[,number2][,sep])

If only given one argument, this function returns a list of numbers from 0 to number1-1. If number1 is less than 1, nothing is returned.

If given at least two arguments, this function returns a list of numbers from number1 to number2. If number2 is less than number1, the list will be in descending order, otherwise, the list will be in ascending order. Negative integers are valid.

sep is used as the separator character, if given.

Examples

> say lnum(5)
You say "0 1 2 3 4"
> say lnum(3,7)
You say "3 4 5 6 7"
> say lnum(4,-2,|)
You say "4|3|2|1|0|-1|-2"
> say lnum(2,6,@@)
You say "23456"

(--Soylent 01:23, 3 December 2005 (EST))