Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,10 +0,0 @@
type Restricted is range 1..10;
My_Var : Restricted;
if My_Var = 5 then
-- do something
elsif My_Var > 5 then
-- do something
else
-- do something
end if;

View file

@ -1,13 +0,0 @@
type Operation is (Add, Subtract, Multiply, Divide);
Op : Operation;
Result : Integer;
-- we assume that A and B are inputs.
Result := (if Op = Add then
A + B
elsif Op = Subtract then
A - B
elsif Op = Multiply then
A * B
elsif Op = Divide then
A / B
);

View file

@ -1,6 +0,0 @@
Result := (case Op is
Add => A + B,
Subtract => A - B,
Multiply => A * B,
Divide => A / B
);

View file

@ -1 +0,0 @@
case Op of...

View file

@ -1,13 +0,0 @@
type Days is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday);
Today : Days;
case Today is
when Saturday | Sunday =>
null;
when Monday =>
Compute_Starting_Balance;
when Friday =>
Compute_Ending_Balance;
when others =>
Accumulate_Sales;
end case;

View file

@ -1,9 +0,0 @@
case Today is
when Monday =>
Compute_Starting_Balance;
when Friday =>
Compute_Ending_Balance;
when Tuesday .. Thursday =>
Accumulate_Sales;
-- ignore Saturday and Sunday
end case;

View file

@ -1,10 +0,0 @@
case Today is
when Saturday | Sunday =>
null; -- don't do anything, if Today is Saturday or Sunday
when Monday =>
Compute_Starting_Balance;
when Friday =>
Compute_Ending_Balance;
when Tuesday .. Thursday =>
Accumulate_Sales;
end case;

View file

@ -1,7 +0,0 @@
select
accept first_entry;
-- do something
or accept second_entry;
-- do something
or terminate;
end select;

View file

@ -1,5 +0,0 @@
select
My_Task.Start;
or
delay Timeout_Period;
end select;

View file

@ -1,8 +1,4 @@
num: 2
arturoIsAwesome: true
if? num=2 [
print "yep, num is 2"
]
else [
print "something went wrong..."
]
if arturoIsAwesome ->
print "Yes, it is!"

View file

@ -1,7 +1,4 @@
loop 1..5 'num [
case [num]
when? [<2] -> print [num ": it's less than 2"]
when? [=2] -> print [num ": it's 2!"]
when? [=3] -> print [num ": it's 3!"]
else -> print [num ": the number is too big"]
]
itRains: false
unless itRains ->
print "We are going for a walk!"

View file

@ -1,10 +0,0 @@
If <expression> Then
statements
...
[ElseIf expression-n Then
[elseif statements ... ]]
...
[Else
[else statements]
...
EndIf

View file

@ -1,11 +0,0 @@
Select
Case <expression>
statement1
...
[Case
statement2
...]
[Case Else
statementN
...]
EndSelect

View file

@ -1,11 +0,0 @@
Switch <expression>
Case <value> [To <value>] [,<value> [To <value>] ...]
statement1
...
[Case <value> [To <value>] [,<value> [To <value>] ...]
statement2
...]
[Case Else
statementN
...]
EndSwitch

View file

@ -1,19 +0,0 @@
if condition-1
imperative-statement-1
else
imperative-statement-2
end-if
if condition-1
if condition-a
imperative-statement-1a
else
imperative-statement-1
end-if
else
if condition-a
imperative-statement-2a
else
imperative-statement-2
end-if
end-if

View file

@ -1,33 +0,0 @@
evaluate identifier-1
when 'good'
good-imperative-statement
when 'bad'
bad-imperative-statement
when 'ugly'
when 'awful'
ugly-or-awful-imperative-statement
when other
default-imperative-statement
end-evaluate
evaluate true
when condition-1
condition-1-imperative-statement
when condition-2
condition-2-imperative-statement
when condition-3
condition-3-imperative-statement
when other
default-condition-imperative-statement
end-evaluate
evaluate identifier-1 also identifier-2
when 10 also 20
one-is-10-and-two-is-20-imperative-statement
when 11 also 30
one-is-11-and-two-is-30-imperative-statement
when 20 also any
one-is-20-and-two-is-anything-imperative-statement
when other
default-imperative-statement
end-evaluate

View file

@ -1,20 +0,0 @@
# standard if
if (condition) {
# ...
}
# if-then-else
if (condition) {
# ...
} else {
# ...
}
# if-then-elseif-else
if (condition) {
# ...
} elseif (condition2) {
# ...
} else {
# ...
}

View file

@ -1,30 +0,0 @@
# standard switch
switch ($var) {
1 { "Value was 1" }
2 { "Value was 2" }
default { "Value was something else" }
}
# switch with wildcard matching
switch -Wildcard ($var) {
"a*" { "Started with a" }
"*x" { "Ended with x" }
}
# switch with regular expression matching
switch -Regex ($var) {
"[aeiou]" { "Contained a consonant" }
"(.)\1" { "Contained a character twice in a row" }
}
# switch allows for scriptblocks too
switch ($var) {
{ $_ % 2 -eq 0 } { "Number was even" }
{ $_ -gt 100 } { "Number was greater than 100" }
}
# switch allows for handling a file
switch -Regex -File somefile.txt {
"\d+" { "Line started with a number" }
"\s+" { "Line started with whitespace" }
}

View file

@ -1,14 +0,0 @@
If condition1 Then
statement
End If
If condition1 Then
statement
ElseIf condition2 Then
statement
...
ElseIf conditionN Then
statement
Else
statement
End If

View file

@ -1,3 +0,0 @@
If condition Then statement
If condition Then statement Else statement

View file

@ -1,19 +0,0 @@
Select Case Expression
Case Value1: statement
Case Value2: statement
...
Case ValueN: statement
Case Else: statement
End Select
Select Case Expression
Case Value1
statements
Case Value2
statements
...
Case ValueN
statements
Case Else
statements
End Select