Difference between revisions of "User:Fivesteaks"

From All The Fallen Stories
Jump to navigation Jump to search
Line 1: Line 1:
Test pages:
Test pages:
[[Module:FivesteaksPersistentTest]]
[[Module:FivesteaksPersistentTest]] | FSStore:


(Code to be included, if/when proc_open is enabled:)
{{#invoke:FivesteaksPersistentTest|FSStore}}
  local p = {}


  function p.FSStore( frame )
[[User:Fivesteaks/PersistentReadTest]]
      _G.FivesteaksPersistentTest = "Testing Persistent Variables"
  end
 
  function p.FSShow( frame )
      return _G.FivesteaksPersistentTest
  end
 
  return p
 
 
----
 
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 = "<pre>"
  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 .. "</pre>"
end
</lua>
 
==99 Bottles of Beer==
{{#luaexpr:count(99)}}

Revision as of 19:22, 5 November 2016

Test pages: Module:FivesteaksPersistentTest | FSStore:

{{#invoke:FivesteaksPersistentTest|FSStore}}

User:Fivesteaks/PersistentReadTest