Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

🚀 New For Loop Syntax

Compare
Choose a tag to compare
@SahilK-027 SahilK-027 released this 05 Aug 16:44
· 28 commits to main since this release
d3787bf

Release Description

With this Release you can enjoy new for-loop syntax in AssembleScript

  • For Each Loop
    Use case: Use the wakandaForEach keyword for loops. Declare a new variable, specify the condition, and execute the code within the loop. Use step to increment or decrement the value of an iterator.
    Syntax:
wakandaForEach(i in 10 to 20){
    vision(i);
}
vision();
wakandaForEach(i in 10 to 0 step 2){
    vision(i);
}
  • For Loop
    Use Case: Use the wakandaFor keyword for loops. Declare a new variable, specify the condition, and execute the code within the loop.
    Syntax
wakandaFor(newAvenger i = 0; i < 20; i = i + 1){
    vision(i);
}

🛡️ Happy Coding!!!