mIRC Home    About    Download    Register    News    Help

Print Thread
#29789 14/06/03 05:11 PM
Joined: Jan 2003
Posts: 4
E
Self-satisified door
OP Offline
Self-satisified door
E
Joined: Jan 2003
Posts: 4
i would like to see $base somehow be able to go over base 36

#29790 14/06/03 05:40 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
And what exactly would be the characters used to represent such bases?

#29791 15/06/03 11:21 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
$base could use an inlist and outlist parameter to determine the characters to use.

var %inlist = 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+-=
var %outlist = 0123456789nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM!@#$%^&*()_+-=
var %s = $base($1-,76,76,0,0,%inlist,%outlist)


Could be fun. Would be nice if $base ignored unknown characters, rather than ending when it hits one. It could treat unknown characters as a separator of two real numbers to process. For the above example at least, it would ROT13 the text without failing upon the first symbol not included.

- Raccoon

Last edited by Raccoon; 15/06/03 11:25 PM.

Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#29792 15/06/03 11:25 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well that won't work exactly. For example in base16, "A" and "a" are both the same number, 10. So how exactly would I specify an "inlist" that would allow for ABCDEF being the same as abcdef?

#29793 15/06/03 11:27 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
It would use case sensitivity if an %inlist or %outlist is specified. Or perhaps case-insensitive for characters that only appear once in each list.

If you have an inlist and no outlist or an outlist with no inlist, a default case would have to be used. More specifically, $base would have a defined/known default inlist/outlist of 36 characters that would be used.

Last edited by Raccoon; 15/06/03 11:31 PM.

Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard