-
Notifications
You must be signed in to change notification settings - Fork 11
Stack Operations
DJMcMayhem edited this page Sep 29, 2017
·
13 revisions
Swaps the top two elements in place
(({}({}))[({}[{}])])
Rolls the top 3 elements a,b,c,.. -> c,a,b,..
(({}(({}({}))[({}[{}])]))[({}[{}])])
Put the top element at the bottom of the stack
({}<(([])<{{}({}<>)<>([])}{}<>>)<>>)<>{({}[()]<({}<>)<>>)}{}<>
Put the bottom element on the top of the stack
(([][()])<{({}[()]<({}<>)<>>)}{}<>>)<>({}<<>{({}[()]<({}<>)<>>)}{}<>>)
Reverses the stack down to a depth of n
(n){((({}[()])<{({}[()]<({}<({}<>)<>>)>)}{}>)<{({}[()]<<>({}<>)>)}{}>)}{}
Sorts the entire stack
([]){({}[()]<(([])<{({}[()]<([([({}<(({})<>)<>>)<><({}<>)>]{}<(())>)](<>)){({}())<>}{}({}<><{}{}>){{}<>(<({}<({}<>)<>>)<>({}<>)>)}{}({}<>)<>>)}{}<>{}>[()]){({}[()]<({}<>)<>>)}{}<>>)}{}