This site requires JavaScript, please enable it in your browser!
Greenfoot back
n1ght5t41xX
n1ght5t41xX wrote ...

2019/4/24

Quick question concerning a for loop

n1ght5t41xX n1ght5t41xX

2019/4/24

#
Gday, once again I am practicing for my little exam and I stumbled onto another error that I cant get behind - this time with a for loop. Here is the piece of code (Its supposed to be a countdown that stops at 0)
public void countDown()
    {
        for (int i = 100; i >= 0; i--)
        {
            getWorld().showText(Integer.toString(i),450,200);
        }
    }
When I run it, it simply displays the number 0. Thanks in Advance
n1ght5t41xX n1ght5t41xX

2019/4/24

#
Solved it myself - I forgot to put a delay into it. Still leaving this here for education purposes haha
You need to login to post a reply.