mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2025-12-11 23:21:28 +00:00
23 lines
404 B
Plaintext
23 lines
404 B
Plaintext
/stack
|
|
var/list
|
|
contents=new
|
|
proc
|
|
Push(value)
|
|
contents+=value
|
|
|
|
Pop()
|
|
if(!contents.len) return null
|
|
. = contents[contents.len]
|
|
contents.len--
|
|
|
|
Top() //returns the item on the top of the stack without removing it
|
|
if(!contents.len) return null
|
|
return contents[contents.len]
|
|
|
|
Copy()
|
|
var/stack/S=new()
|
|
S.contents=src.contents.Copy()
|
|
return S
|
|
|
|
Clear()
|
|
contents.Cut() |