Evaluated eval [wget https://dpaste.com/45NFJ9E7D.txt]
This commit is contained in:
parent
bf91966b98
commit
4edae87313
@ -1,18 +1,18 @@
|
|||||||
{s n} {
|
{s n} {
|
||||||
set c [csplit $s]
|
set c [csplit $s]
|
||||||
if {$n > [expr [llength [lindex $c 0]]-1]} {set n [expr [llength [lindex $c 0]]-1]}
|
if {$n > [expr [llength [lindex $c 0]]-1]} {set n [expr [llength [lindex $c 0]]-1]}
|
||||||
set b 0
|
set b 0
|
||||||
set u 0
|
set u 0
|
||||||
set cf -1
|
set cf -1
|
||||||
set cb -1
|
set cb -1
|
||||||
set r ""
|
set r ""
|
||||||
foreach f [lindex $c 1] {
|
foreach f [lindex $c 1] {
|
||||||
if {[lindex $f 0] > $n} {
|
if {[lindex $f 0] > $n} {
|
||||||
if {$b eq 1} {append r "\002"}
|
if {$b eq 1} {append r "\002"}
|
||||||
if {$u eq 1} {append r "\037"}
|
if {$u eq 1} {append r "\037"}
|
||||||
if {$cf > -1} {append r [format "%s" $cf]}
|
if {$cf > -1} {append r [format "\002%s" $cf]}
|
||||||
if {$cb > -1} {append r [format ",%s" $cb]}
|
if {$cb > -1} {append r [format ",%s" $cb]}
|
||||||
return $r
|
return $r
|
||||||
}
|
}
|
||||||
if {[lindex $f 1] eq "\002"} {set b [expr $b ^ 1]}
|
if {[lindex $f 1] eq "\002"} {set b [expr $b ^ 1]}
|
||||||
if {[lindex $f 1] eq "\037"} {set u [expr $u ^ 1]}
|
if {[lindex $f 1] eq "\037"} {set u [expr $u ^ 1]}
|
||||||
@ -22,7 +22,7 @@
|
|||||||
if {[set m [regexp -inline {([\d]+)$} [lindex $f 1]]] ne ""} {set cf [lindex $m 1]}
|
if {[set m [regexp -inline {([\d]+)$} [lindex $f 1]]] ne ""} {set cf [lindex $m 1]}
|
||||||
if {[set m [regexp -inline {([\d]+),([\d]+)} [lindex $f 1]]] ne ""} {set cf [lindex $m 1];set cb [lindex $m 2]}
|
if {[set m [regexp -inline {([\d]+),([\d]+)} [lindex $f 1]]] ne ""} {set cf [lindex $m 1];set cb [lindex $m 2]}
|
||||||
}
|
}
|
||||||
if {$b eq 1} {append r "\002"}
|
if {$b eq 1} {append r "\002"}
|
||||||
if {$u eq 1} {append r "\037"}
|
if {$u eq 1} {append r "\037"}
|
||||||
if {$cf > -1} {append r [format "%s" $cf]}
|
if {$cf > -1} {append r [format "%s" $cf]}
|
||||||
if {$cb > -1} {append r [format ",%s" $cb]}
|
if {$cb > -1} {append r [format ",%s" $cb]}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user