RosettaCodeData/Task/Stack/EasyLang/stack.easy

23 lines
262 B
Text
Raw Permalink Normal View History

2024-03-06 22:25:12 -08:00
stack[] = [ ]
proc push v . .
stack[] &= v
.
func pop .
2024-04-19 16:56:29 -07:00
lng = len stack[]
if lng = 0
2024-03-06 22:25:12 -08:00
return 0
.
2024-04-19 16:56:29 -07:00
r = stack[lng]
2024-03-06 22:25:12 -08:00
len stack[] -1
return r
.
func empty .
return if len stack[] = 0
.
push 2
push 11
push 34
while empty = 0
print pop
.