Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
29
Task/Sort-three-variables/Seed7/sort-three-variables.seed7
Normal file
29
Task/Sort-three-variables/Seed7/sort-three-variables.seed7
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const proc: genSort3 (in type: elemType) is func
|
||||
begin
|
||||
global
|
||||
|
||||
const proc: doSort3 (in var elemType: x, in var elemType: y, in var elemType: z) is func
|
||||
local
|
||||
var array elemType: sorted is 0 times elemType.value;
|
||||
begin
|
||||
writeln("BEFORE: x=[" <& x <& "]; y=[" <& y <& "]; z=[" <& z <& "]");
|
||||
sorted := sort([](x, y, z));
|
||||
x := sorted[1];
|
||||
y := sorted[2];
|
||||
z := sorted[3];
|
||||
writeln("AFTER: x=[" <& x <& "]; y=[" <& y <& "]; z=[" <& z <& "]");
|
||||
end func;
|
||||
|
||||
end global;
|
||||
end func;
|
||||
|
||||
genSort3(integer);
|
||||
genSort3(string);
|
||||
|
||||
const proc: main is func
|
||||
begin
|
||||
doSort3(77444, -12, 0);
|
||||
doSort3("lions, tigers, and", "bears, oh my!", "(from the \"Wizard of OZ\")");
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue