Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
36
Task/Sort-three-variables/FALSE/sort-three-variables.false
Normal file
36
Task/Sort-three-variables/FALSE/sort-three-variables.false
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ [s]waps two variables. (varref; varref) → () }
|
||||
[
|
||||
b: { loads the value at the top of the stack into b }
|
||||
a: { loads the value at the top of the stack into a }
|
||||
|
||||
a;; t: { loads the value stored in the variable stored in a (hence the double dereference) into t }
|
||||
b;; a;: { loads the value stored in the variable stored in b into the variable stored in a }
|
||||
t; b;: { loads the value stored in t into the variable stored in b }
|
||||
]s:
|
||||
|
||||
{ [p]rints the three variables. }
|
||||
[
|
||||
"X = " x;. 10,
|
||||
"Y = " y;. 10,
|
||||
"Z = " z;. 10,
|
||||
]p:
|
||||
|
||||
77444 x:
|
||||
12_ y:
|
||||
0 z:
|
||||
|
||||
p;!
|
||||
|
||||
{ if x > y, swap x and y }
|
||||
x;y;> [xys;!] ?
|
||||
|
||||
{ if y > z, swap y and z }
|
||||
y;z;> [yzs;!] ?
|
||||
|
||||
{ if x > y, swap x and y }
|
||||
x;y;> [xys;!] ?
|
||||
|
||||
"After sorting:
|
||||
"
|
||||
|
||||
p;!
|
||||
Loading…
Add table
Add a link
Reference in a new issue