$randtok

By thegingon on Jun 26, 2013

the script is choose random token.
$randtok(text,c)

;// $randtok(text,c) \\
alias randtok { return $gettok($1,$rand(1,$numtok($1,$2)),$2) }

Comments

Sign in to comment.
Sorasyn   -  Jun 27, 2013

No need to use up more memory than necessary,

alias randtok { return $gettok($1,$rand(1,$numtok($1,$2)),$2) }

Nice and easy. :)

[Plornt]  -  Jun 28, 2013

Well in my opinion for readability its such a small tradeoff that really its not worth not putting it in 2 vars first.

SReject  -  Jun 28, 2013

Just to make Sunny look like a good guy:

alias randtok { tokenize -i $2 $1 | return $($ $+ $r(1,$0),2) }
Conscious  -  Jun 28, 2013

You're missing an 'i' in tokenize, @SReject

thegingon  -  Jun 28, 2013

well you right @Sorasyn but it easier to read in the old way, but you 100% right :)
@SReject your code is use less 3 bytes less then @Sorasyn one :)

SReject  -  Jun 30, 2013

@Conscious Fixed

@thegingon I had a typo. Its fixed now, And I did it just to show that Sunny's wasn't the worst 'shortcode' for readability

[Plornt]  -  Jun 30, 2013

Eh I couldnt make it shorter but I could make it even more less readable :)

alias randtok { return $regsubex($1,/(.+?)(?:\x $+ $base($2,10,16) $+ |$)/g,) $+ $regml($r(1,$regml(0))) }
thegingon  -  Jun 30, 2013

Well @[Plornt], you did it :)

Savage_CL  -  Aug 09, 2013

Well @[Plornt], I made yours shorter

alias randtok return $regsubex($1,/(.+?)(?:\x $+ $base($2,10,16) $+ |$)/g,) $+ $regml($r(1,$regml(0)))
SReject  -  Aug 09, 2013

Not to be that guy but.... @[Plornt] & Savage_CL:

alias randtok return $regml($r(1,$regex($1,/([^\x $+ $base($2,10,16) $+ ]+)/g)))
Conscious  -  Aug 10, 2013

Slightly shorter than yours, @SReject :

alias randtok return $regml($r(1,$regex($1,/([^\ $+ $base($2,10,8) $+ ]+)/g)))
Sorasyn  -  Aug 11, 2013

Unfortunately, I'm not adept enough with mIRC to be a contender in this war of bytes.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.