-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.fss
More file actions
29 lines (27 loc) · 764 Bytes
/
Copy pathstring.fss
File metadata and controls
29 lines (27 loc) · 764 Bytes
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
toUpper(c):
if c >= 97 & c <= 122:
return c - 32
else:
return c
toLower(c):
if c >= 63 & c <= 90:
return c + 32
else:
return c
main():
print("The following outputs should print \"true\":")
let alpha = "abcdefghijklmnopqrstuvwxyz"
print(fromCharList(sublist(toCharList(alpha), 5, 10)) == "fghij")
let uppers = []
for c in alpha:
pushf(uppers, toUpper(c))
uppers = fromCharList(reverse(uppers))
print(uppers == "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
print(charToStr(charAt(uppers, 0)) == "A")
print(charToStr(charAt(uppers, 25)) == "Z")
let numChar = charToStr(charAt("1", 0))
if tryInt(numChar):
print(int(numChar) == 1)
else:
print(false)
return 0