Evaluated eval [wget https://dpaste.com/C8U7QH44L.txt]
This commit is contained in:
parent
d65434ad64
commit
a47f3f88dd
30
procs/778ea439ab6c6ee8718b27fa17634bef1ffad57b
Normal file
30
procs/778ea439ab6c6ee8718b27fa17634bef1ffad57b
Normal file
@ -0,0 +1,30 @@
|
||||
{s n} {
|
||||
set c [csplit $s]
|
||||
if {$n > [expr [llength [lindex $c 0]]-1]} {set n [expr [llength [lindex $c 0]]-1]}
|
||||
set b 0
|
||||
set u 0
|
||||
set cf -1
|
||||
set cb -1
|
||||
set r ""
|
||||
foreach f [lindex $c 1] {
|
||||
if {[lindex $f 0] > $n} {
|
||||
if {$b eq 1} {append r "\002"}
|
||||
if {$u eq 1} {append r "\037"}
|
||||
if {$cf > -1} {append r [format "%s" $cf]}
|
||||
if {$cb > -1} {append r [format ",%s" $cb]}
|
||||
return $r
|
||||
}
|
||||
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 "\003"} {set cf -1;set cb -1}
|
||||
if {[lindex $f 1] eq "\017"} {set cf -1;set cb -1;set b 0;set u 0}
|
||||
if {[lindex $f 1] eq "\026"} {set t $cb;set cb $cf;set cf $t}
|
||||
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 {$b eq 1} {append r "\002"}
|
||||
if {$u eq 1} {append r "\037"}
|
||||
if {$cf > -1} {append r [format "%s" $cf]}
|
||||
if {$cb > -1} {append r [format ",%s" $cb]}
|
||||
return $r
|
||||
}
|
@ -10,6 +10,7 @@ _lex_fridman_reading 5a1df4f81f8e92fe879f3e9370f132b24e43daae
|
||||
_lex_fridman_reading_inner 9c10d20ef25f4c3fb4c51b91640338fd3629cddf
|
||||
_n_r_r 61d461e02e7bcef8ea98f079a322145ce65e0754
|
||||
alex_fridman_reading bcdfd11e8c234b51147cb33c5b5ece3cf5e21758
|
||||
c_at_n 778ea439ab6c6ee8718b27fa17634bef1ffad57b
|
||||
char 71fafc4e2fc1e47e234762a96b80512b6b5534c2
|
||||
color 6dd0fe8001145bec4a12d0e22da711c4970d000b
|
||||
csplit 9dee0e0c9de58ce43e88d97c66a4ded3761de9fd
|
||||
|
Loading…
x
Reference in New Issue
Block a user