Feb-20-2019, 08:18 PM
Don't search for it, build it. Start with 1. 1 evenly divides into that. 2 does not, and there is no common divisor, so multiply by 2 to get 2. 3 does not evenly divide into 2, and there is no common divisor, so multiply by 3 to get 6. 4 does not divide into 6 evenly, but it has a common divisor of 2. So multiply 6 by (4 / 2) to get 12. Keep going up to 20.
You would need to build a greatest common divisor function, (or use the one in the math or fractions module), but then you can build it piece by piece rather than searching for it, which should be faster.
You would need to build a greatest common divisor function, (or use the one in the math or fractions module), but then you can build it piece by piece rather than searching for it, which should be faster.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures