Getting Started with Lua

Lua is an extremely simple scripting language known for it's speed. no it's not c++ but as far as dynamically typed languages go it pretty well takes the cake.
Lua is well known in the gaming industry and has been used in many games. it has been used in major games including some of my favorites Crysis and Elder Scrolls IV: Oblivion. Lua is capable of OO via what are known as meta methods. it's an extremely interesting language and is definitely worth a look. also one of the big reasons it's used in so many games is becuase of how easily you can embed it in your own applications.
IDEAS:
* write a program that prints it's own source code, this is known as a quine
* write a sorting algorithm
* write a linked list class (this one is a little tricky as Lua provides no direct means of making classes)
* write a program to find the nth highest prime number
* make a simple Lua embedded application in c/c++ that exposes a function to Lua
print("hello world")
print("5+5=" .. 5+5)
MyTable = {ishka="bible"}
for first,second in pairs(MyTable) do
if first=="ishka" and second=="bible" then
print(first.." + "..second,"=",first..second)
end
end
for i=0,10,1 do
print(i)
end
i=10
while i~=0 do
i=i-1
print(i)
end
function Foo()
local MyStr = "see how easy Lua can be!!"
print(MyStr)
end
Foo()
RESOURCES (mostly on embedding, the first one is on the language it'self):
http://lua-users.org...torialDirectory
http://www.codeproje...p/luaincpp.aspx
http://cc.byexamples...ed-lua-51-in-c/
http://gamedevgeek.c...arted-with-lua/
you can download the latest version here or here

New Topic/Question
Reply





MultiQuote










|