Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
25
Task/Stack/GDScript/stack.gd
Normal file
25
Task/Stack/GDScript/stack.gd
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue