Sha256: f7d41129e8b96a498ab18808752abf072acbf1cb1e13ed21fc07ea0729216402

Contents?: true

Size: 837 Bytes

Versions: 396

Compression:

Stored size: 837 Bytes

Contents

local house = {}

local stuff = {
  'the house that Jack built.',
  'the malt\nthat lay in ',
  'the rat\nthat ate ',
  'the cat\nthat killed ',
  'the dog\nthat worried ',
  'the cow with the crumpled horn\nthat tossed ',
  'the maiden all forlorn\nthat milked ',
  'the man all tattered and torn\nthat kissed ',
  'the priest all shaven and shorn\nthat married ',
  'the rooster that crowed in the morn\nthat woke ',
  'the farmer sowing his corn\nthat kept ',
  'the horse and the hound and the horn\nthat belonged to '
}

house.verse = function(which)
  local verse = ''
  for i = 1, which do
    verse = stuff[i] .. verse
  end
  return 'This is ' .. verse
end

house.recite = function()
  local verses = {}
  for i = 1, #stuff do
    table.insert(verses, house.verse(i))
  end
  return table.concat(verses, '\n')
end

return house

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.0.6.0 tracks/lua/exercises/house/example.lua
trackler-2.0.5.18 tracks/lua/exercises/house/example.lua
trackler-2.0.5.17 tracks/lua/exercises/house/example.lua
trackler-2.0.5.16 tracks/lua/exercises/house/example.lua
trackler-2.0.5.15 tracks/lua/exercises/house/example.lua
trackler-2.0.5.14 tracks/lua/exercises/house/example.lua
trackler-2.0.5.13 tracks/lua/exercises/house/example.lua
trackler-2.0.5.12 tracks/lua/exercises/house/example.lua
trackler-2.0.5.11 tracks/lua/exercises/house/example.lua
trackler-2.0.5.10 tracks/lua/exercises/house/example.lua
trackler-2.0.5.9 tracks/lua/exercises/house/example.lua
trackler-2.0.5.8 tracks/lua/exercises/house/example.lua
trackler-2.0.5.7 tracks/lua/exercises/house/example.lua
trackler-2.0.5.6 tracks/lua/exercises/house/example.lua
trackler-2.0.5.5 tracks/lua/exercises/house/example.lua
trackler-2.0.5.4 tracks/lua/exercises/house/example.lua
trackler-2.0.5.3 tracks/lua/exercises/house/example.lua
trackler-2.0.5.2 tracks/lua/exercises/house/example.lua
trackler-2.0.5.1 tracks/lua/exercises/house/example.lua
trackler-2.0.5.0 tracks/lua/exercises/house/example.lua