reorganizing code

This commit is contained in:
cozis
2022-03-12 23:17:44 +01:00
parent de11b968fb
commit 2dcfbd194e
18 changed files with 141 additions and 335 deletions
+5 -5
View File
@@ -2,8 +2,8 @@
stack = {count: 0, head: none};
fun push(stack, value)
{
fun push(stack, value) {
node = {prev: none, item: value};
node.prev = stack.head;
@@ -11,10 +11,10 @@ fun push(stack, value)
stack.count = stack.count + 1;
}
fun pop(stack)
{
fun pop(stack) {
if stack.head == none:
return none; # return it; ?
return none;
value = stack.head.item;
stack.head = stack.head.prev;