Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
|
|
@ -0,0 +1,26 @@
|
|||
// Simple version
|
||||
print "Simple version:"
|
||||
s2 = "This is the first string."
|
||||
s1 = "This is string number two."
|
||||
|
||||
if s1.len > s2.len then
|
||||
print s1.len + ": " + s1
|
||||
print s2.len + ": " + s2
|
||||
else
|
||||
print s2.len + ": " + s2
|
||||
print s1.len + ": " + s1
|
||||
end if
|
||||
|
||||
// Extra credit. More than 2 strings
|
||||
strings = ["qwerty", "abc", "#FFFFFFFF", "255,255,255,255", "3.14159"]
|
||||
pairs = []
|
||||
for string in strings
|
||||
pairs.push([string, string.len])
|
||||
end for
|
||||
// sort by index descending
|
||||
pairs.sort(1, false)
|
||||
print
|
||||
print "Extra credit:"
|
||||
for pair in pairs
|
||||
print pair[1] + ": " + pair[0]
|
||||
end for
|
||||
Loading…
Add table
Add a link
Reference in a new issue