Page MenuHomeDevCentral

Decypher cyber-shaman
ActivePublic

Authored by dereckson on Jun 18 2015, 04:31.
Tags
None
Referenced Files
F3315: Masterwork From Distant Lands
Jun 18 2015, 04:31
Subscribers
None
set fd [open code.txt r]
set code [gets $fd]
close $fd
proc bin2dec {bin} {
if {$bin == 0} {
return 0
} elseif {[string match -* $bin]} {
set sign -
set bin [string range $bin 1 end]
} else {
set sign {}
}
if {[string map [list 1 {} 0 {}] $bin] ne {}} {
error "argument is not in base 2: $bin"
}
set r 0
foreach d [split $bin {}] {
incr r $r
incr r $d
}
return $sign$r
}
for {set i 0} {$i < 100} {incr i} {
set start [expr $i * 8]
puts -nonewline [format %c [bin2dec [string range $code $start [expr $start+7]]]]
}

Event Timeline

dereckson changed the title of this paste from untitled to Masterwork From Distant Lands.
dereckson updated the paste's language from autodetect to autodetect.
dereckson changed the title of this paste from Masterwork From Distant Lands to Decypher cyber-shaman.Jun 18 2015, 04:33
dereckson updated the paste's language from autodetect to tcl.