Christmas colors
Posted by Rustynails
Wednesday, December 21, 2005
Description: Make your text look like christmas!
Usage: $c(text) or /c <text>
This is a bit long because unlike most scripts, this allows commas to be used instead of totally avoiding them...
Usage: $c(text) or /c <text>
This is a bit long because unlike most scripts, this allows commas to be used instead of totally avoiding them...
alias c {
if (!$isid) {
var %r = 1
while (%r <= $len($1-)) {
var %q = %q $+ $iif($mid($1-,$calc(%r - 1),1) == $chr(32),$chr(32),) $+ $iif($calc(%r % 2) == 0,[^K]04,[^K]03) $+ $mid($1-,%r,1)
inc %r
}
say [^B] $+ %q
}
else {
%x = 1
while (%x <= $0) {
var %r = 1
while (%r <= $len($eval($+($chr(36),%x),2))) {
var %q = %q $+ $iif(%r == 1,$chr(32),$iif($mid($eval($+($chr(36),%x),2),$calc(%r - 1),1) == $chr(32),$chr(32),)) $+ $iif($calc(%r % 2) == 0,[^K]04,[^K]03) $+ $mid($eval($+($chr(36),%x),2),%r,1)
inc %r
}
var %q = %q $+ $iif($mid($($+($chr(36),%x)),$calc(%r - 1),1) == $chr(32),$chr(32),) $+ $iif($calc(%r % 2) == 0,[^K]04,[^K]03) $+ $chr(44)
inc %x
}
return [^B] $+ $right($left(%q,-1),-1)
}
}