Add Lua code for chapter 6-9 (#36)

* Add Lua code for chapter 6

* Add Lua code for chapter 7

* Add Lua code for chapter 8

* Add Lua code for chapter 9
This commit is contained in:
zhangjiongwx
2017-11-14 00:14:24 +08:00
committed by Aditya Bhargava
parent ec2890a93d
commit d0ac45bcde
6 changed files with 279 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
if word_a[i] == word_b[j] then
-- The letters match.
cell[i][j] = cell[i - 1][j - 1] + 1
else
-- The letters don't match.
cell[i][j] = math.max(cell[i - 1][j], cell[i][j - 1])
end