Home› Programming
Discussion
Back to discussions page
Jstewart
Posts: 59 Apprentice
Script |
61 views
|
Answered | |
/ Most recent by Nicholas_Francoeur
in Programming
|
1 comment |

in Programming
I am trying to learn more about the script programming side of things and so i created a program with just a Square Pallet wizard inside. I then got the script file from that program and opened it up to see how it was programmed. I noticed on part of the program it has:
So i understand its using the cnt variable but what does the % 2 and floor() mean? I looked all through the script manual and couldnt find anything on that. I know its probably something simple but I just cant wrap my head around it.
cnt_1_x = cnt_1 % 2
cnt_1_y = floor(cnt_1 / 2)
So i understand its using the cnt variable but what does the % 2 and floor() mean? I looked all through the script manual and couldnt find anything on that. I know its probably something simple but I just cant wrap my head around it.
Here's what you'll get from the UR script manual:
Floor(f):
Returns largest integer not greater than f
And for the %:
The % is the modulus operator. In that case, it would divide the count by 2 and find the remainder.
Co-Founder | Vanguard Robotics
e: [email protected]
w: vanguard-robotics.com