Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
|
|
@ -8,3 +8,5 @@ echo("< : ", s1 < s2)
|
|||
echo("<= : ", s1 <= s2)
|
||||
echo("> : ", s1 > s2)
|
||||
echo(">= : ", s1 >= s2)
|
||||
# cmpIgnoreCase(a, b) => 0 if a == b; < 0 if a < b; > 0 if a > b
|
||||
echo("cmpIgnoreCase :", s1.cmpIgnoreCase s2)
|
||||
|
|
|
|||
29
Task/String-comparison/Robotic/string-comparison.robotic
Normal file
29
Task/String-comparison/Robotic/string-comparison.robotic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
set "$str1" to "annoy"
|
||||
set "$str2" to "annoy"
|
||||
: "loop"
|
||||
if "$str1" === "$str2" then "case_equal"
|
||||
if "$str1" = "$str2" then "equal"
|
||||
if "$str1" > "$str2" then "greater_than"
|
||||
if "$str1" < "$str2" then "less_than"
|
||||
end
|
||||
|
||||
: "case_equal"
|
||||
* "&$str1& is case equal to &$str2&"
|
||||
set "$str2" to "ANNOY"
|
||||
goto "loop"
|
||||
|
||||
: "equal"
|
||||
* "&$str1& is equal to &$str2&"
|
||||
set "$str2" to "allow"
|
||||
wait for 100
|
||||
goto "loop"
|
||||
|
||||
: "greater_than"
|
||||
* "&$str1& is lexicographically greater than &$str2&"
|
||||
set "$str1" to "aardvark"
|
||||
wait for 100
|
||||
goto "loop"
|
||||
|
||||
: "less_than"
|
||||
* "&$str1& is lexicographically less than &$str2&"
|
||||
end
|
||||
10
Task/String-comparison/Vala/string-comparison.vala
Normal file
10
Task/String-comparison/Vala/string-comparison.vala
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
void main() {
|
||||
var s1 = "The quick brown";
|
||||
var s2 = "The Quick Brown";
|
||||
stdout.printf("== : %s\n", s1 == s2 ? "true" : "false");
|
||||
stdout.printf("!= : %s\n", s1 != s2 ? "true" : "false");
|
||||
stdout.printf("< : %s\n", s1 < s2 ? "true" : "false");
|
||||
stdout.printf("<= : %s\n", s1 <= s2 ? "true" : "false");
|
||||
stdout.printf("> : %s\n", s1 > s2 ? "true" : "false");
|
||||
stdout.printf(">= : %s\n", s1 >= s2 ? "true" : "false");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue