Compare commits

..

2 Commits

13 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,8 @@
-- 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.
-- 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.
--
-- Solution --------------------------------------------------------------------
function greatest_common_divisor(x, y)

View File

@ -4,10 +4,12 @@ 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.
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.
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 anagrams.lua`. For each
anagrams exercise, you would run `lua 08_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.