The WSQ12 asked me to do a program that calculatesthe gcm, which is the greatest common divisor, the largest number that both number had as divisor.

It asked to use the algorithm of a greek guy named Euclidean, so I entered wikipedia, the best site for quick info, and the first thing I se is a bunch of symbols and letters, soooooooooo I quit

wiki

Then I was like, f it, amagona do my own algorithm with tacos and tequila, so I took a piece pof paper and solved one problem, 63 and 49. Here is the pic:

12181980_10208005403723194_792210695_n

Sooo is like the x 63 module y 49, the reesidual is i 14, Then, x takes the value of y, and y the value of i, and then I repeat the process until the residual is cero

so the code will be:

i = x mod y

x = y

y = i

and repeat, and here it is:

wsq012

Well… at last, I see is kind of similar as the one of Euclidean, soooo, it was allright 🙂

As always

Github link

CC BY 4.0 WSQ12: GCD, Easy when done by charliegdrummer is licensed under a Creative Commons Attribution 4.0 International License.