Skip to content

Instruction 2 POP_N

HoverCatz edited this page Feb 8, 2024 · 1 revision

This will POP (aka remove) the last N elements (the top/the right-most/the last added element) on the stack.

Example N: ${\space\color{#947cdd}2\color{white}\space}$

Stack before: ${[\space\color{#947cdd}A\space\color{white}, \space\color{#947cdd}B\color{white}\space, \space\color{#947cdd}C\color{white}\space]}$

POP_N <2>

Stack after: ${[\space\color{#947cdd}A\space\color{white}]}$

Values popped: ${[\space\color{#947cdd}B\color{white}\space, \space\color{#947cdd}C\color{white}\space]}$

Clone this wiki locally