; Mod Example ; ----------- ; Mod returns the REMAINDER after dividing the left side by the right. Print "10 Mod 3 = "+(10 Mod 3)+" (10 = 3*3 with 1 left over)" Print "12 Mod 4 = "+(12 Mod 4)+" (divides exactly, no remainder)" Print "7 Mod 10 = "+(7 Mod 10)+" (7 is smaller than 10, so it IS the remainder)" Print "-7 Mod 3 = "+(-7 Mod 3)+" (the result takes the sign of the left side)" Print "" ; Mod keeps values cycling round a fixed range - great for clocks, ; wrapping angles and looping animation frames Print "9 o'clock plus 6 hours: (9+6) Mod 12 = "+((9+6) Mod 12) Print "" Print "Looping a 4-frame animation with tick Mod 4:" For tick=0 To 9 Write (tick Mod 4)+" " Next Print "" Print "" Print "Press any key to close the example" WaitKey End