Data update

This commit is contained in:
Ingy döt Net 2024-03-06 22:25:12 -08:00
parent ed705008a8
commit 0df55f9f24
2196 changed files with 32999 additions and 3075 deletions

View file

@ -0,0 +1,21 @@
stack[] = [ ]
proc push v . .
stack[] &= v
.
func pop .
if len stack[] = 0
return 0
.
r = stack[-1]
len stack[] -1
return r
.
func empty .
return if len stack[] = 0
.
push 2
push 11
push 34
while empty = 0
print pop
.

View file

@ -2,7 +2,7 @@ public program()
{
var stack := new system'collections'Stack();
stack.push:2;
stack.push(2);
var isEmpty := stack.Length == 0;

View file

@ -0,0 +1,25 @@
extends Node2D
func _ready() -> void:
# Empty stack creation.
var stack : Array = []
# In Godot 4.2.1 nothing happens here.
stack.pop_back()
if stack.is_empty():
print("Stack is empty.")
stack.push_back(3)
stack.push_back("Value")
stack.push_back(1.5e32)
print(stack)
print("Last element is: " + str(stack.back()))
stack.pop_back()
print(stack)
print("Last element is: " + str(stack.back()))
if not stack.is_empty():
print("Stack is not empty.")
return

View file

@ -0,0 +1,3 @@
[3] # Since UIUA is a stack language, everything is pushed on the stack
x ← # stores the top of the stack into the variable x
? # ? checks the stack, it is now empty

View file

@ -1,4 +1,4 @@
import "/seq" for Stack
import "./seq" for Stack
var s = Stack.new()
s.push(1)