User:Fivesteaks

From All The Fallen Stories
Revision as of 04:10, 1 November 2016 by Fivesteaks (talk | contribs)
Jump to navigation Jump to search

Test pages: Module:FivesteaksPersistentTest

Lua test: <lua> function bottle(x)

 if x > 1 then
   return x .. " bottles of beer"
 elseif x == 1 then
   return "One bottle of beer"
 else
   return "No more bottles of beer"
 end

end

function count(x)

output = "

"
  for beer = x, 1, -1 do
    output = output .. bottle(beer) .. " on the wall,\n"
    output = output .. bottle(beer) .. ",\n"
    output = output .. "Take one down, pass it around,\n"
    output = output .. bottle(beer-1) .. " on the wall.\n"
    output = output .. "\n\n"
  end
  return output .. "

"

end </lua>

99 Bottles of Beer

{{#luaexpr:count(99)}}