for loops explained code example
Example 1: for loop
for (let i = 0; i < array.length; i++) {
}
Example 2: for loop
for(int i = 0; i < some_number; i++){
}
Example 3: for loops
MyString = ""
for i in range(5):
MyString += "hi"
print(MyString)
Example 4: for loop
Coroutine doThisCoroutine;
int duration = 5
float waitTime = 1
void Awake(){
DoThisCoroutine = StartCoroutine(DoThis());
}
IEnumerator DoThis(){
while (enabled){
for (int x = 0; x < Duration; x++){
print("Doing This!");
yield return new WaitForSeconds(waitTime)
}
}
}