Code: Select all
proc gettok {txt n c} {
set c [format %c $c]
set txt [split $txt $c]
if {[string match *- $n]} {
scan $n[llength $txt] %i-%i a b
} elseif {[string match -* $n]} {
set b [llength $txt]
set a [expr $b$n]
} elseif {[string match *-* $n]} {
scan $n %i-%i a b
} {
set a [set b $n]
}
join [lrange $txt $a $b] $c
}
indeed. user, wanna take a look at a 93kb voting script?CrazyCat wrote:he's a good scripter, isn't he?
Don't be shy I didn't mean to make you feel bad. Sorry for that. Here's a proc to make it up to you.cerberus_gr wrote:I wanted to paste my code here, but now I'll feel bad, after your post user Thx
Code: Select all
proc gettok {txt n c} {
set c [format %c $c]
set txt [split $txt $c]
set i [llength $txt]
if {[scan $n %i-%i a b]==2 ||\
[scan $n[expr {$i-1}] %i-%i a b]==2 ||\
([scan $n %i a]&&[set b $a]!="")} {
join [lrange $txt [expr {$a%$i}] [expr {$b%$i}]] $c
}
}
Compress it to about 20k first and I'll have a look (and use extremely short variable names or english words or I will hate reading your code )arcane wrote:wanna take a look at a 93kb voting script?
hehe... its 16kb zipped and i used english variable namesuser wrote:Compress it to about 20k first and I'll have a look (and use extremely short variable names or english words or I will hate reading your code )arcane wrote:wanna take a look at a 93kb voting script?