Skip to content
DJMcMayhem edited this page Sep 29, 2017 · 13 revisions

Top Swap

Swaps the top two elements in place

(({}({}))[({}[{}])])

Small Roll

Rolls the top 3 elements a,b,c,.. -> c,a,b,..

(({}(({}({}))[({}[{}])]))[({}[{}])])

Roll

Put the top element at the bottom of the stack

({}<(([])<{{}({}<>)<>([])}{}<>>)<>>)<>{({}[()]<({}<>)<>>)}{}<>

Reverse Roll

Put the bottom element on the top of the stack

(([][()])<{({}[()]<({}<>)<>>)}{}<>>)<>({}<<>{({}[()]<({}<>)<>>)}{}<>>)

Stack Reverse

Reverses the stack down to a depth of n

(n){((({}[()])<{({}[()]<({}<({}<>)<>>)>)}{}>)<{({}[()]<<>({}<>)>)}{}>)}{}

Bubble Sort

Sorts the entire stack

([]){({}[()]<(([])<{({}[()]<([([({}<(({})<>)<>>)<><({}<>)>]{}<(())>)](<>)){({}())<>}{}({}<><{}{}>){{}<>(<({}<({}<>)<>>)<>({}<>)>)}{}({}<>)<>>)}{}<>{}>[()]){({}[()]<({}<>)<>>)}{}<>>)}{}
Clone this wiki locally