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

2017/3/6

What does this mean?

JokeNotFound JokeNotFound

2017/3/6

#
1
if (time%55 == 0) showText(""+(time/55), 50, 50);
syrup2000 syrup2000

2017/3/6

#
THIS IS SO Confuddling! XD
Super_Hippo Super_Hippo

2017/3/6

#
If the time is divisible by 55 without rest (so time = {0, 55, 110, 165, ...}), show the current time/55 value at (50|50) in the world (and remove any other showText which was previously at this position). 55 is about the number of act cycles per second when the slider is in the middle.
Nosson1459 Nosson1459

2017/3/7

#
The '%' is the remainder operator. It returns the remainder of the two dividends instead of returning a double (decimal number). So 100 / 55 = 1818181818... (1 + 9/11), but 100 % 55 = 45. So if you do == 0 afterwards that means that there is no remainder meaning that the number is a multiple of 55. The code above will show a 1 when time == 55 and a 2 when time == 110 and so on.
You need to login to post a reply.