Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,5 +1,3 @@
|
|||
defer lessthan ( a@ b@ -- ? ) ' < is lessthan
|
||||
|
||||
: mid ( l r -- mid ) over - 2/ -cell and + ;
|
||||
|
||||
: exch ( addr1 addr2 -- ) dup @ >r over @ swap ! r> swap ! ;
|
||||
|
|
@ -7,8 +5,8 @@ defer lessthan ( a@ b@ -- ? ) ' < is lessthan
|
|||
: partition ( l r -- l r r2 l2 )
|
||||
2dup mid @ >r ( r: pivot )
|
||||
2dup begin
|
||||
swap begin dup @ r@ lessthan while cell+ repeat
|
||||
swap begin r@ over @ lessthan while cell- repeat
|
||||
swap begin dup @ r@ < while cell+ repeat
|
||||
swap begin r@ over @ < while cell- repeat
|
||||
2dup <= if 2dup exch >r cell+ r> cell- then
|
||||
2dup > until r> drop ;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue