We had a program exactly like this due in Introductory Computer Programming, using Visual Basic we used modular division, which used the "\" symbol, not sure if the same goes for Torquescript