-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[proc,script212].cs2
75 lines (75 loc) · 1.81 KB
/
[proc,script212].cs2
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// 212
[proc,script212](string $string0)(string)
def_string $string1 = tostring(^max_32bit_int);
def_int $int0 = string_length($string0);
if ($int0 <= 0) {
return("0");
}
if ($int0 > 10) {
return($string1);
}
$string0 = lowercase($string0);
def_int $int1 = 0;
def_string $string2 = "";
def_string $string3 = "";
def_string $string4 = "";
while ($int1 < $int0) {
$string2 = substring($string0, $int1, calc($int1 + 1));
if (compare($string2, "k") = 0) {
if ($int0 > 8) {
return($string1);
}
$string3 = substring($string0, 0, $int1);
if ($int0 > calc($int1 + 1)) {
$string4 = substring($string0, calc($int1 + 1), $int0);
} else {
$string4 = "";
}
$string0 = append(append($string3, "000"), $string4);
$int0 = calc($int0 + 2);
$string2 = "0";
} else if (compare($string2, "m") = 0) {
if ($int0 > 5) {
return($string1);
}
$string3 = substring($string0, 0, $int1);
if ($int0 > calc($int1 + 1)) {
$string4 = substring($string0, calc($int1 + 1), $int0);
} else {
$string4 = "";
}
$string0 = append(append($string3, "000000"), $string4);
$int0 = calc($int0 + 5);
$string2 = "0";
} else if (compare($string2, "b") = 0) {
if ($int0 > 2) {
return($string1);
}
$string3 = substring($string0, 0, $int1);
if ($int0 > calc($int1 + 1)) {
$string4 = substring($string0, calc($int1 + 1), $int0);
} else {
$string4 = "";
}
$string0 = append(append($string3, "000000000"), $string4);
$int0 = calc($int0 + 8);
$string2 = "0";
}
$int1 = calc($int1 + 1);
}
if ($int0 < 10) {
return($string0);
}
def_int $int2 = 0;
$int1 = 0;
while ($int1 < $int0) {
$int2 = compare(substring($string0, $int1, calc($int1 + 1)), substring($string1, $int1, calc($int1 + 1)));
if ($int2 > 0) {
return($string1);
}
if ($int2 < 0) {
return($string0);
}
$int1 = calc($int1 + 1);
}
return($string0);