Difference between revisions of "variable"

(Created page with "A variable is a value like val, var, and any other letter or word that is not already assigned to something else.")
 
(added an example)
Line 1: Line 1:
 
A variable is a value like val, var, and any other letter or word that is not already assigned to something else.
 
A variable is a value like val, var, and any other letter or word that is not already assigned to something else.
 +
 +
==Example==
 +
Changes a variable by 1 each time the left mouse button is clicked
 +
<source lang="lua">
 +
function love.mousepressed( x, y, button )
 +
if button == "l" then
 +
time = time + 1
 +
end

Revision as of 15:47, 18 June 2013

A variable is a value like val, var, and any other letter or word that is not already assigned to something else.

Example

Changes a variable by 1 each time the left mouse button is clicked <source lang="lua"> function love.mousepressed( x, y, button ) if button == "l" then time = time + 1 end