Chapter 3: Basic Functions and Control Structures
Downloads
This chapter does not have any code to download
Table of Contents
- Chapter 3: Basic Functions and Control Structures - 39
- Using Functions - 39
- Creating a Function - 39
- Local Functions - 40
- Function Arguments and Returns - 41
- Converting Celsius to Fahrenheit - 41
- Empty Arguments - 42
- No Return Values - 42
- Functions as Lua Values - 42
- Making Decisions with the if Statement - 43
- Simple Conditionals - 43
- Complex Expressions - 44
- Extended Conditionals - 44
- Displaying a Personalized Greeting - 45
- Repeating Actions with the while Statement - 46
- Computing Factorials - 46
- Differences Between while and repeat - 47
- Looping with the Numeric for Statement - 48
- Computing Factorials - 50
- Evaluation of Loop Conditionals - 50
- Variable Scope in for Loops - 50
- Summary - 51
Errata
There is no errata listed for this chapter yet