mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
21 lines
426 B
Plaintext
21 lines
426 B
Plaintext
/stack
|
|
var/list/contents=new
|
|
/stack/proc/Push(value)
|
|
contents+=value
|
|
|
|
/stack/proc/Pop()
|
|
if(!contents.len) return null
|
|
. = contents[contents.len]
|
|
contents.len--
|
|
|
|
/stack/proc/Top() //returns the item on the top of the stack without removing it
|
|
if(!contents.len) return null
|
|
return contents[contents.len]
|
|
|
|
/stack/proc/Copy()
|
|
var/stack/S=new()
|
|
S.contents=src.contents.Copy()
|
|
return S
|
|
|
|
/stack/proc/Clear()
|
|
contents.Cut() |