Family Day update

This commit is contained in:
Ingy döt Net 2020-02-17 23:21:07 -08:00
parent aac6731f2c
commit 9ad63ea473
2442 changed files with 39761 additions and 8255 deletions

View file

@ -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)

View 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

View 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");
}