new example
FossilOrigin-Name: d3a4d01e151c86e306b9dff8b18148d977ef108de8cedfb8848a055ccf2bb28d
This commit is contained in:
parent
f4005e5c02
commit
881d81f492
1 changed files with 10 additions and 0 deletions
10
example/sort-on-stack.forth
Normal file
10
example/sort-on-stack.forth
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
~~~
|
||||||
|
:sort-pair dup-pair lt? [ swap ] if ;
|
||||||
|
:perform-sort sort-pair depth #2 gt? [ [ perform-sort ] dip ] if ;
|
||||||
|
:sort depth [ perform-sort ] times ;
|
||||||
|
~~~
|
||||||
|
|
||||||
|
~~~
|
||||||
|
#3 #33 #22 #333 #5 sort
|
||||||
|
~~~
|
||||||
|
|
Loading…
Reference in a new issue