Home Programming


Left ArrowBack to discussions page
JstewartJstewart Posts: 62 Apprentice
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:

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.


  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy

    Here's what you'll get from the UR script manual:

    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.
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
Sign In or Register to comment.
Left ArrowBack to discussions page