Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/String-comparison/Lua/string-comparison.lua
Normal file
19
Task/String-comparison/Lua/string-comparison.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
function compare(a, b)
|
||||
print(("%s is of type %s and %s is of type %s"):format(
|
||||
a, type(a),
|
||||
b, type(b)
|
||||
))
|
||||
if a < b then print(('%s is strictly less than %s'):format(a, b)) end
|
||||
if a <= b then print(('%s is less than or equal to %s'):format(a, b)) end
|
||||
if a > b then print(('%s is strictly greater than %s'):format(a, b)) end
|
||||
if a >= b then print(('%s is greater than or equal to %s'):format(a, b)) end
|
||||
if a == b then print(('%s is equal to %s'):format(a, b)) end
|
||||
if a ~= b then print(('%s is not equal to %s'):format(a, b)) end
|
||||
print ""
|
||||
end
|
||||
|
||||
compare('YUP', 'YUP')
|
||||
compare('BALL', 'BELL')
|
||||
compare('24', '123')
|
||||
compare(24, 123)
|
||||
compare(5.0, 5)
|
||||
Loading…
Add table
Add a link
Reference in a new issue