Let's give it a shot and see how powerful a language Lua is. We're starting to get an idea of how variables work and what happens when you assign a value to it. What if you have a variable that has multiple values attached to it? How does Lua differentiate them? We'll be using the Corona
Terminal
so we can see the values outputted in the terminal box. Along the way, you'll pick up other programming techniques as you progress through this section. We will also be referring to chunks in this exercise. The unit of execution of Lua is called a chunk. A chunk is a sequence of statements, which are executed sequentially.
If you remember from the previous chapter, we learned how to create our own project folder and main.lua
file for the Hello World application.
Create a new project folder on your desktop and name it
Variables
.Open up your preferred text editor and save it as
main.lua
in yourVariables
project folder.Create the following variables:
local...