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
20
Task/Integer-comparison/LiveCode/integer-comparison.livecode
Normal file
20
Task/Integer-comparison/LiveCode/integer-comparison.livecode
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
ask question "Enter 2 numbers (comma separated)" with empty titled "Enter 2 numbers"
|
||||
if it is not empty then
|
||||
put item 1 of it into num1
|
||||
put item 2 of it into num2
|
||||
if isnumber(num1) and isnumber(num2) then
|
||||
if num1 < num2 then answer num1 && "is less than" && num2
|
||||
if num1 is num2 then answer num1 && "is equal to" && num2
|
||||
if num1 > num2 then answer num1 && "is greater than" && num2
|
||||
|
||||
-- alternative is to use switch case construct
|
||||
switch
|
||||
case (num1 < num2)
|
||||
answer num1 && "is less! than" && num2; break
|
||||
case (num1 > num2)
|
||||
answer num1 && "is greater! than" && num2; break
|
||||
case (num1 = num2)
|
||||
answer num1 && "equal! to" && num2
|
||||
end switch
|
||||
end if
|
||||
end if
|
||||
Loading…
Add table
Add a link
Reference in a new issue