Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Generic-swap/Metafont/generic-swap-1.metafont
Normal file
12
Task/Generic-swap/Metafont/generic-swap-1.metafont
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
vardef swap(suffix a, b) =
|
||||
save ?; string s_;
|
||||
if boolean a: boolean ?
|
||||
elseif numeric a: numeric ? % this one could be omitted
|
||||
elseif pair a: pair ?
|
||||
elseif path a: path ?
|
||||
elseif pen a: pen ?
|
||||
elseif picture a: picture ?
|
||||
elseif string a: string ?
|
||||
elseif transform a: transform ? fi;
|
||||
? := a; a := b; b := ?
|
||||
enddef;
|
||||
12
Task/Generic-swap/Metafont/generic-swap-2.metafont
Normal file
12
Task/Generic-swap/Metafont/generic-swap-2.metafont
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
j := 10;
|
||||
i := 5;
|
||||
show j, i;
|
||||
swap(j,i);
|
||||
show j, i;
|
||||
|
||||
boolean truth[];
|
||||
truth1 := true;
|
||||
truth2 := false;
|
||||
show truth1, truth2;
|
||||
swap(truth1,truth2);
|
||||
show truth1, truth2;
|
||||
Loading…
Add table
Add a link
Reference in a new issue