Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Dahaarl | |
Old Version | Published before Godot 3 was released. |
Hello Godot users !
I’m quite a noob in (gd)script and especially in Arrays so I wonder how I could compare data between two arrays.
My goal is to find all sports in common between all this people and save them in the “Sports” array. I know that it’s possible in other languages but I can’t figure it out in GdScript.
var Agnes = [
"Basketball",
"Football",
"Handball",
"Tennis",
"Rugby"
]
var John = [
"Basketball",
"Football",
"Handball",
"Tennis"
]
var Paul = [
"Basketball",
"Handball",
"Tennis",
"Rugby"
]
var Cindy = [
"Handball",
"Tennis",
"Rugby"
]
var Sports = []
Thanks !