Stueue

From Esolang
Jump to navigation Jump to search

stueue is a stack but when you pop something off the top it switches to bottom, making it a queue every even-numbered pop and a stack every odd-numbered pop. duplicates, peeks, and other similar non-popping operations do not change the position. drop does change the position, however

its "being popped" value is called bop overall.

operations

pop - return and remove bop of stueue and then toggles queue mode
drop - remove bop of stueue and then toggles queue mode
peek - return bop of stueue without removing it
dup - duplicates bop
swap - swaps bop and pre-bop
rot - rotates bop, pre-bop, and pre-pre-bop.
rotcc - same as rot but counter clockwise

trick to ensue a switch

dup drop