Top

Range of Numbers $x-y

+ 0 likes
Please Register to submit score.
Average Score  4.0
Scores Submitted  3
Date Added  Jan 07, 2007
Last Updated  Sep 30, 2007
Tags  num  numbers  range 

Introduction

This is a simple custom identifier where you enter two numbers and the asc value of a character to seperate them with and it gives you a list of numbers between the first two, sperated by the character you specify.

Example: //echo -a $x-y(4,20,32) returns 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
//echo -a $x-y(-1,10,46) returns -1.0.1.2.3.4.5.6.7.8.9.10
//echo -a $x-y(10,-4,46) returns 10.9.8.7.6.5.4.3.2.1.0.-1.-2.-3.4.

Grab the Code

Comments

  (4)  RSS
Scakk
Comments: 214
 
mIRC Snippet:  Range of Numbers $x-y
Posted on Sep 30, 2007 2:31 pm
This is not working for me

//echo -a $x-y(3,15,32) -> * /echo: insufficient parameters
//echo -a $x-y(3,4,32) --> * /echo: insufficient parameters
//echo -a $x-y(13,4,46) -> * /echo: insufficient parameters

I tried several more times with the same out come.
Lindrian
Comments: 728
 
mIRC Snippet:  Range of Numbers $x-y
Posted on Sep 30, 2007 3:44 pm
Remove if ($1-3 isnum) { and it works fine.
Scakk
Comments: 214
 
mIRC Snippet:  Range of Numbers $x-y
Posted on Sep 30, 2007 3:51 pm
Works now. Thanks Lindrian.
RubixCube
Comments: 51
 
mIRC Snippet:  Range of Numbers $x-y
Posted on Sep 30, 2007 8:39 pm
Updated your code:
Code:
 
alias x-y {
  if ($1 <= $2) {
    var %r = $1
    while (%r <= $2) {
      var %x = $addtok(%x,%r,$3)
      inc %r
    }
  }
  elseif ($1 > $2) {
    var %r = $1
    while (%r >= $2) {
      var %x = $addtok(%x,%r,$3)
      dec %r
    }
  }
  return %x
}

Please Register or Login to start posting comments.
Bottom