Hey guys, I'm new to programming and I really hit the wall here. I know what modulo or modulus is but my comprehension falls short in this case. BTW this is exactly taken from the puzzle game template. I want to figure out how loops work and how can I iterate an objects n times but don't understand what that modulo node does here. I know it is a simple and stupid question but I really want to learn this stuff.
Announcement
Collapse
No announcement yet.
Modulo?
Collapse
X

modulo returns the remaining number of a division. for example: 20 % 8 = 4.
step1: 20 / 8 = 2
step2: 2 * 8 = 16
step3: 20  16 = 4
the algorithm is basically: A  (B * Floor(A / B)). Floor() rounds down a number. so instead of 20 / 8 = 2.5, it rounds it down to 2.0. hope its clear now.
 1 like
Comment
Comment