AINE: Accelerated Interactive Narrator Engine
  • Download
  • References
  • Games
  • Wiki
  • Facebook Twitter
  • Name

    while

  • Examples

    Object: allItems
    {
    items: [item1, item2, item3, item4]
    size: 4
    }

    Item: item1
    Item: item2
    Item: item3
    Item: item4

    Player: {
    i:
    items [item1,item3]

    Event: "Give Random Item" {
    // Rolls a new number while player has the respective item
    // Gives player either item2 or item4 when the whole loop has complete

    i = -1
    while(i < 0 || hasItem(allItems.items[i]))
    i = floor(rand(0,allItems.size))

    giveItem(allItems.items[i])
    }
    }
  • Description

    Continues to loop until the expression is false, or the loop is broken using break.
  • Syntax

    • while(expression){statements}
  • Related

    • break

    • if

    • for

    • foreach

  • Contact
  • Terms of Use
  • GitHub
  • Drakkashi.com

The copyright of all images rendered by me goes to their respective owners.
© 2008 Daniel Svejstrup Christensen