Godot Version
4.7
Question
English is not my native language, and the explanation on this one got a bit to complicated for me.
I know and understand what it does, but there are code I don’t understand.
Does anyone bother too try to explain it in a bit simpler way for me who does not have a master in programming …
Its “for turn in range” and “%” I struggle with.
var type_of_drink:Array[String] = [“Beer”, “Juice”, “Coffee”, “Vodka”, “Cola”, “Water”]
var total_turns: int = 15
for turn in range(total_turns):
var index: int = turn % type_of_drink.size()
var member: String = type_of_drink[index]
print(“Turn”, turn, “:”, " This is a ", member)
M:)