User talk:Johnrdorazio: Difference between revisions

Line 25: Line 25:
$myVar = "PHP variable";
$myVar = "PHP variable";
$myVarUpper = strtoupper($myVar);
$myVarUpper = strtoupper($myVar);
</syntaxhighlight>
'''LUA'''
<syntaxhighlight lang="lua" line>
-- defines a factorial function
function fact (n)
  if n == 0 then
    return 1
  else
    return n * fact(n-1)
  end
end
print("enter a number:")
a = io.read("*number")        -- read a number
print(fact(a))
</syntaxhighlight>
</syntaxhighlight>