-
Notifications
You must be signed in to change notification settings - Fork 0
/
rot13.spwn
42 lines (37 loc) · 1.12 KB
/
rot13.spwn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
extract obj_props;
encode_string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
letters = "abcdefghijklmnopqrstuvwxyz";
let string_display = "";
for char in encode_string {
if letters.contains(char.lowercase()) {
for letter in letters {
if char.lowercase() == letter {
if char.is_lower() {
if letters.index(char) + 13 >= 26 {
string_display += "{}".fmt(letters[(letters.index(char) + 13) - 26]);
};
else {
string_display += "{}".fmt(letters[letters.index(char) + 13]);
};
};
else if char.is_upper() {
if letters.index(char.lowercase()) + 13 >= 26 {
string_display += "{}".fmt(letters[(letters.index(char.lowercase()) + 13) - 26].uppercase());
};
else {
string_display += "{}".fmt(letters[letters.index(char.lowercase()) + 13].uppercase());
};
};
};
};
};
else {
string_display += char;
};
};
$.add(obj {
OBJ_ID: 914,
X: 300,
Y: 90,
TEXT: $.b64encode(string_display),
});