Compare commits
2 Commits
8edca7f075
...
3052288380
Author | SHA1 | Date | |
---|---|---|---|
3052288380 | |||
3558a24b47 |
@ -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)
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user