Sha256: c0281dbb7f72391bf6ec0a630bd84402b798f24f7ccb3bea7671a2e3add0886a

Contents?: true

Size: 443 Bytes

Versions: 396

Compression:

Stored size: 443 Bytes

Contents

local bob = {}

local function shouting(say)
  return string.upper(say) == say
end

local function nothing(say)
  return say == nil or string.len(say) == 0
end

local function question(say)
  return string.sub(say, -1) == '?'
end

function bob.hey( say )
  if nothing(say)  then return 'Fine, be that way.' end
  if shouting(say) then return "Whoa, chill out!" end
  if question(say) then return "Sure" end
  return "Whatever"
end

return bob

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.179 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.178 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.177 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.176 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.175 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.174 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.173 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.172 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.171 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.170 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.169 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.167 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.166 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.165 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.164 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.163 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.162 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.161 tracks/lua/exercises/bob/example.lua
trackler-2.2.1.160 tracks/lua/exercises/bob/example.lua