The only error I have is in searching if a value is found within the array vector3
I would also like to know how to initialize a vector3 array
var Positions :[] vector3 = array{}
Words: []string =array{"hola", "pedro"}
var TestA: []int = array{3,4,3,3,3}
Test():void=
#string
NewWord: string = "hola"
if(IndexString:=Words.Find[NewWord]){}
#int
if(IndexInt:=TestA.Find[3]){}
#vector3
newVector: vector3 = vector3{X:=0.0,Y:=0.0,Z:=0.0}
if(IndexPosition:=Positions.Find[newVector]){}
#error: This function parameter expects a value of type tuple([]comparable,tuple(),comparable), but this argument is an incompatible value of type tuple([]vector3,tuple(),vector3).
Vector3 are not comparable and you can’t implement your own comparable type, either you wrap it up inside a class (which is comparable) or you convert the vector3 to a string, you could also compare each value (X,Y,Z) with its int value.
Basically, string, class and int are comparable types so use those instead
Last question: In your experience, which would you recommend using, Array or Map? I understand how both work, but I would like to know why you would use one over the other and in what situations it is advisable to use an Array or a Map.
Depends, I’m usually using maps if I need to use .Find[] on an array at some point, indexing makes it better. I don’t know how to explain it better though, use array and when you can’t do what you want with them, use maps