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 values to them. What if you have a variable that has multiple values attached to it? How does Lua differentiate them? We'll use the Corona terminal so that 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 refer to chunks in this exercise. The unit of execution in Lua is called a chunk. A chunk is a block that is executed sequentially. Follow these steps on getting started with Lua:
If you remember, in the previous chapter, you learned how to create your 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...