|
If you are learning Lua, here are some more examples
During some courses, I write few (if any) new examples in front of my delegates, rather relying on the standard ones in the training notes (which I wrote anyway!) and making small changes and adjustments to illustrate how things work. On other courses, though, I write a some new examples from scratch - and such was the case during last Thurday and Friday's two day Lua training class.
Here - primarily for the delagates in that class - are links to the many of the new examples, which I have added to our on line resource. If you follow the links to any of these, you'll be offered links to other related examples too!
Lua Fundamentals
Comments in Lus
Simple sting.format example
for loop example in Lua
strip.rep to repeat a string
getting the minimum value from a table in Lua
Pattern Matching -getting names from amongst a stream of punctuation
Lua functions and modules
Variable number of arguments to a function
Lua functions to return larger of two values and largest of a table of values
How sorting works in Lua - looking under the counter
A Lua program that calls in a module and the module itself
An function which could usefully be turned into a coroutine and that example amended to run as a coroutine
Towards Object Orientation in Lua
A reminder of tables
Adding Lusa's metables to change functionallity
Creating and using a table of Lua 'objects'
Redefining operator behaviour on tables in Lua
Lua is a really excellent language with a small "footprint" - the more I use it, the more I like it (and I like it a lot!). You won't find the "bloat" of other open source languages, but you WILL find nifty and useful features which come together to make it a very valuable programming tool; it's this feature set that has led to its widespead adoption in the games industry where (for example) it's used in "The world or Warcraft" to customise the user interface. (written 2008-07-06 11:13:25)
Associated topics are indexed under U101 - Introduction to Lua.U102 - Lua - Numbers and the Math library.U106 - Lua - Functions.U109 - Lua - ModulesU107 - Object Orientation - the Lua wayU114 - Lua - Threading and Coroutines.
Some other Articles
Perl ... adding to a list - end, middle, startRunning operating system commands in PerlTraining Course and Business Conference TechnologyFTP server on Fedora LinuxIf you are learning Lua, here are some more examplesDealing with The PressSorting in lua - specifying your own sort routineSaying NOT in Perl, PHP, Python, Lua ...Lua Course - here is the indexDefensive coding techniques in PHP?
|
1829 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37 at 50 posts per page
This is a page archived from The Horse's Mouth at
http://www.wellho.net/horse/ -
the diary and writings of Graham Ellis.
Every attempt was made to provide current information at the time the
page was written, but things do move forward in our business - new software
releases, price changes, new techniques. Please check back via
our main site for current courses,
prices, versions, etc - any mention of a price in "The Horse's Mouth"
cannot be taken as an offer to supply at that price.
Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).
|
|