Stack: Difference between revisions

208 bytes added ,  12 years ago
Add Brat solution
(Cleaned up push and pop by removing the need for make-node)
(Add Brat solution)
Line 304:
Cannot pop (h)
Stack is empty</pre>
 
=={{header|Brat}}==
Built in arrays have push, pop, and empty? methods:
 
<lang Brat>stack = []
stack.push 1
stack.push 2
stack.push 3
 
until { stack.empty? } { p stack.pop }</lang>
 
Output:
<pre>3
2
1</pre>
 
=={{header|C}}==