Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -2,57 +2,57 @@ alias modn [ mod (+ (mod $arg1 $arg2) $arg2) $arg2 ]
|
|||
//Cubescript's built-in mod will fail on negative numbers
|
||||
|
||||
alias cipher [
|
||||
push alpha [
|
||||
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
|
||||
"a b c d e f g h i j k l m n o p q r s t u v w x y z"
|
||||
] [ push chars [] [
|
||||
loop i (strlen $arg1) [
|
||||
looplist n $alpha [
|
||||
if (! (listlen $chars)) [
|
||||
alias chars (? (> (listindex $n (substr $arg1 $i 1)) -1) $n [])
|
||||
]
|
||||
]
|
||||
alias arg1 (
|
||||
concatword (substr $arg1 0 $i) (
|
||||
? (> (listindex $chars (substr $arg1 $i 1)) -1) (
|
||||
at $chars (
|
||||
modn (+ (
|
||||
listindex $chars (substr $arg1 $i 1)
|
||||
) $arg2) (listlen $chars)
|
||||
)
|
||||
) (substr $arg1 $i 1)
|
||||
) (substr $arg1 (+ $i 1) (strlen $arg1))
|
||||
)
|
||||
alias chars []
|
||||
]
|
||||
] ]
|
||||
result $arg1
|
||||
push alpha [
|
||||
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
|
||||
"a b c d e f g h i j k l m n o p q r s t u v w x y z"
|
||||
] [ push chars [] [
|
||||
loop i (strlen $arg1) [
|
||||
looplist n $alpha [
|
||||
if (! (listlen $chars)) [
|
||||
alias chars (? (> (listindex $n (substr $arg1 $i 1)) -1) $n [])
|
||||
]
|
||||
]
|
||||
alias arg1 (
|
||||
concatword (substr $arg1 0 $i) (
|
||||
? (> (listindex $chars (substr $arg1 $i 1)) -1) (
|
||||
at $chars (
|
||||
modn (+ (
|
||||
listindex $chars (substr $arg1 $i 1)
|
||||
) $arg2) (listlen $chars)
|
||||
)
|
||||
) (substr $arg1 $i 1)
|
||||
) (substr $arg1 (+ $i 1) (strlen $arg1))
|
||||
)
|
||||
alias chars []
|
||||
]
|
||||
] ]
|
||||
result $arg1
|
||||
]
|
||||
|
||||
alias decipher [
|
||||
push alpha [
|
||||
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
|
||||
"a b c d e f g h i j k l m n o p q r s t u v w x y z"
|
||||
] [ push chars [] [
|
||||
loop i (strlen $arg1) [
|
||||
looplist n $alpha [
|
||||
if (! (listlen $chars)) [
|
||||
alias chars (? (> (listindex $n (substr $arg1 $i 1)) -1) $n [])
|
||||
]
|
||||
]
|
||||
alias arg1 (
|
||||
concatword (substr $arg1 0 $i) (
|
||||
? (> (listindex $chars (substr $arg1 $i 1)) -1) (
|
||||
at $chars (
|
||||
modn (- (
|
||||
listindex $chars (substr $arg1 $i 1)
|
||||
) $arg2 ) (listlen $chars)
|
||||
)
|
||||
) (substr $arg1 $i 1)
|
||||
) (substr $arg1 (+ $i 1) (strlen $arg1))
|
||||
)
|
||||
alias chars []
|
||||
]
|
||||
] ]
|
||||
result $arg1
|
||||
push alpha [
|
||||
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
|
||||
"a b c d e f g h i j k l m n o p q r s t u v w x y z"
|
||||
] [ push chars [] [
|
||||
loop i (strlen $arg1) [
|
||||
looplist n $alpha [
|
||||
if (! (listlen $chars)) [
|
||||
alias chars (? (> (listindex $n (substr $arg1 $i 1)) -1) $n [])
|
||||
]
|
||||
]
|
||||
alias arg1 (
|
||||
concatword (substr $arg1 0 $i) (
|
||||
? (> (listindex $chars (substr $arg1 $i 1)) -1) (
|
||||
at $chars (
|
||||
modn (- (
|
||||
listindex $chars (substr $arg1 $i 1)
|
||||
) $arg2 ) (listlen $chars)
|
||||
)
|
||||
) (substr $arg1 $i 1)
|
||||
) (substr $arg1 (+ $i 1) (strlen $arg1))
|
||||
)
|
||||
alias chars []
|
||||
]
|
||||
] ]
|
||||
result $arg1
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue