Introduction to Lua
Slide 1
What Is Lua?
- Embeddable Scripting Language with full class support
- Developed Brasil 1993 for PETROBRAS (Brazilian national iol company) as a data description language
- Used extensively in game development (Dr. Dobbs Journal, 1996). Wikipedia lists 20+ games which use it
- Grim Fandango
- World of Warcraft client
- Warhammer client
- I've coded 500 or so lines in it, so I'm an Expert.
Slide 2
Hello World and other matters
print("hello,world")
hello,world
print("17 + 12 = " .. (17+12))
17 + 12 = 29
Slide 3
The Basis of the Language: the Table
foo={}
- A "dictionary" in python and most other languages
- Anything can be a key or a value
- Lots of syntactic sugar for the simplest cases
- foo[17]="seventeen"
- foo["seventeen"]=17
- print(foo.seventeen) 17
--
CharlesShapiro - 15 Oct 2008