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 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 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 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 do not modify the tests.
the defined order of the exercises, but feel free to deviate if you
wish.
To run the tests and check your solution for a given exercise, simply 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 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 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. 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 -- The greatest common divisor (GCD) of two numbers X and Y is, as the
-- suggests, the largest number which evenly divides both. Implement -- name suggests, the largest number which evenly divides both X and
-- the function below to calculate this. It's recommended that you -- Y. Implement the function below to calculate this.
-- use Euclid's algorithm but feel free to use another approach if you
-- want.
-- --
-- Solution -------------------------------------------------------------------- -- Solution --------------------------------------------------------------------
function greatest_common_divisor(x, y) function greatest_common_divisor(x, y)