Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
10
Task/String-comparison/Lingo/string-comparison-2.lingo
Normal file
10
Task/String-comparison/Lingo/string-comparison-2.lingo
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
-- Returns -1 if str1 is less than str2
|
||||
-- Returns 1 if str1 is greater than str2
|
||||
-- Returns 0 if str1 and str2 are equal
|
||||
on strcmp (str1, str2)
|
||||
h1 = bytearray(str1).toHexString(1, str1.length)
|
||||
h2 = bytearray(str2).toHexString(1, str2.length)
|
||||
if h1<h2 then return -1
|
||||
else if h1>h2 then return 1
|
||||
return 0
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue