June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
35
Task/String-comparison/Falcon/string-comparison.falcon
Normal file
35
Task/String-comparison/Falcon/string-comparison.falcon
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* created by Aykayayciti Earl Lamont Montgomery
|
||||
April 9th, 2018 */
|
||||
|
||||
e = "early"
|
||||
l = "toast"
|
||||
g = "cheese"
|
||||
b = "cheese"
|
||||
e2 = "early"
|
||||
num1 = 123
|
||||
num2 = 456
|
||||
|
||||
> e == e2 ? @ "$e equals $e2" : @ "$e does not equal $e2"
|
||||
> e != e2 ? @ "$e does not equal $e2": @ "$e equals $e2"
|
||||
// produces -1 for less than
|
||||
> b.cmpi(l) == 1 ? @ "$b is grater than $l" : @ "$l is grater than $b"
|
||||
// produces 1 for greater than
|
||||
> l.cmpi(b) == 1 ? @ "$l is grater than $b" : @ "$b is grater than $l"
|
||||
// produces 0 for equal (but could be greater than or equal)
|
||||
> b.cmpi(g) == 1 or b.cmpi(g) == 0 ? @ "$b is grater than or equal to $g" : @ "$b is not >= $g"
|
||||
// produces 0 for equal (but could be less than or equal)
|
||||
>b.cmpi(g) == -1 or b.cmpi(g) == 0 ? @ "$b is less than or equal to $g" : @ "$b is not <= $g"
|
||||
|
||||
function NumCompare(num1, num2)
|
||||
if num1 < num2
|
||||
ans = " < "
|
||||
elif num1 > num2
|
||||
ans = " > "
|
||||
else
|
||||
ans = " = "
|
||||
end
|
||||
return ans
|
||||
end
|
||||
|
||||
result = NumCompare(num1, num2)
|
||||
> @ "$num1 $result $num2"
|
||||
Loading…
Add table
Add a link
Reference in a new issue