Chapter 3 - Basic Functions and Control Structures
Errata
Table of Contents
Basic Functions and Control Structures - 31
- Using Functions - 31
- Creating a Function - 31
- Local Functions - 32
- Function Arguments and Returns - 33
- Converting Celsius to Fahrenheit - 33
- Empty Arguments - 33
- Functions as Lua Values - 34
- Making Decisions with the if Statement - 34
- Simple Conditionals - 35
- Complex Expressions - 35
- Extended Conditionals - 35
- Displaying a Personalized Greeting Redux - 36
- Repeating Actions with the while Statement - 37
- Computing Factorials - 37
- Differences Between while and repeat - 38
- Looping with the Numeric for Statement - 39
- Computing Factorials - 41
- Evaluation of Loop Conditions - 41
- Variable Scope in for Loops - 42
- Summary - 42