Compare commits

..

No commits in common. "305228838048735c2952889b9e0e99701b6789b1" and "8edca7f0753a811ca8e1f5ab82999eb20a2ff22e" have entirely different histories.

13 changed files with 5 additions and 9 deletions

View File

@ -4,12 +4,10 @@ This repo contains some Lua exercises along with automated tests for
their solutions. Each file contains a description of the problem and
an area for your solution as well as the tests. Feel free to define
as many functions and constants as you need in the solution area, but
do not modify the tests. It's recommended that you roughly stick to
the defined order of the exercises, but feel free to deviate if you
wish.
do not modify the tests.
To run the tests and check your solution for a given exercise, simply
run `lua <the-file>`. For example, if you were working on the
anagrams exercise, you would run `lua 08_anagrams.lua`. For each
anagrams exercise, you would run `lua anagrams.lua`. For each
exercise, the tests should run in well under a tenth of a second; if
it takes longer than this you should try to speed up your solution.

View File

@ -1,8 +1,6 @@
-- The greatest common divisor (GCD) of two numbers is, as the name
-- suggests, the largest number which evenly divides both. Implement
-- the function below to calculate this. It's recommended that you
-- use Euclid's algorithm but feel free to use another approach if you
-- want.
-- The greatest common divisor (GCD) of two numbers X and Y is, as the
-- name suggests, the largest number which evenly divides both X and
-- Y. Implement the function below to calculate this.
--
-- Solution --------------------------------------------------------------------
function greatest_common_divisor(x, y)