A class which helps with 2D and 3D arrays and numbers
Still under development, but whats here should work. I plan to add more features and enhance it over time.
var Smaragd = preload("res://smaragd.gd")
func _ready():
var my_array = Smaragd.array_randi(10,2,0,20)
print("Given array: ", my_array)
print("Biggest number: ", Smaragd.array_max(my_array))
print("Smallest number: ", Smaragd.array_min(my_array))
print("Avarage: ", Smaragd.array_avarage(my_array))
Initialize an array and fill it with int,str,etc.
var my_array = Smaragd.array(10,5,0)
Initialize an array with ranged ints
var my_array = Smaragd.array_rangei(10,2,0,20)
Initialize an array and fill it with random integers from range
var my_array = Smaragd.array_randi(10,5,0,10)
Initialize an array and fill it with unique random integers from range.
var my_array = Smaragd.array_randi(10,5,0,10)
Get the biggest int in an array
var my_array = Smaragd.array_randi(10,5,0,10)
print(Smaragd.array_max(my_array))
Get the smallest int in an array
var my_array = Smaragd.array_randi(10,5,0,10)
print(Smaragd.array_min(my_array))
Get avarage of an array
var my_array = Smaragd.array_randi(10,5,0,10)
print(Smaragd.array_avarage(my_array))