Discord
Login
Community
DARK THEME

Loops?

Does anybody know how to use loops properly??? Ive checked the documentation and microStudio cheat sheet but I cant seem to get something effective.

Not sure what problem do you have. Could you give an example?

Loop generally works like this:

init = function()
    // loop 100 times - from i == 0 up to i == 99
    for i = 0 to 99
        // do looping thing here
        print("i is currently " + i)
    end
end

The High Mages and Priests of MicroScript say it can be done this way too

init = function()
    // loop 100 times - from i == 99 up to i == 0
    for i = 99 to 0 by -1
        // do looping thing here
        print("i is currently " + i)
    end
end

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community