Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
20.9.2014 - We have just updated our course layouts and descriptions and added our 2015 schedule.

Lua examples, Lua Courses

Programming training is much more effective if the delegates are shown how a particular program is written, rather than just the final result ... show them just the final result and they'll ask "but how did you come up with that?"

So whenever possible, I write new examples in front of my delegates - spill my guts if you like, describing what I'm writing, and what my logic is behind it. The result is that - by the end of the course - I have a whole folder full of new examples which I then sent through (zipped) to the delegates for them to use as post-course material in addition to the more formal printed notes.

After the three day Lua course in central London that finished yesterday evening, I took the long way round on my way home - a leisurely train ride via Waterloo and Salisbury to Trowbridge, and that gave me the opportunity to tidy up my examples - add in some more comments, and some sample output ... and I've added the better ones to our web resources - and here that are:

furry - Calculations / good variable naming conventions
prncr - Output of a prompt without a new line
wcd - exchange rate loop
whilly - while loop - break and alternative
andor - combining and / or operators
moopark - theme park entrance prices
stem - simple string function use
tat - pairs v ipairs
cleversort - Sorting using a user defined comparator
party - building up a table as data is entered
fav - function as table member - polymorphic tables
dress1 - function call - simple example
dress2 - local variables in a function
dress3 - conditional function definition
fsr - variable number and type of parameters
cuboid - Using a demonstration class
newCube.lua - A demonstration class definition
iiapc - Pattern Match to Postcode, with capture
skill_lister - Read, analyse, sort data from file

I started this article saying how much more effective training is when you see he examples developed interactively, and yet I have now shown them to you as "final results only". However, with the comments I have added they are still a good resource for delegates who have taken some steps in Lua already, or who are geeks who lap up this stuff. If you look at them and think "I wish I could write code like that" ... the come along on our public Lua course or book me for a private course if you've a group of four or more.
(written 2008-08-08, updated 2008-08-09)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
U102 - Lua - Numbers and the Math library.
  [3917] BODMAS - the order a computer evaluates arithmetic expressions - (2012-11-09)
  [2509] A life lesson from the accuracy of numbers in Excel and Lua - (2009-11-21)
  [2345] Automatically initialising Lua variables the first time - (2009-08-10)
  [1699] If you are learning Lua, here are some more examples - (2008-07-06)

U104 - Lua - Strings and the String library.
  [4274] String formatting in Lua - string.format as a wrapper for sprintf - (2014-05-07)
  [2500] Dynamically formatting your results (Lua) - (2009-11-10)
  [2357] Checking if the user has entered a number (Lua) - (2009-08-13)
  [2348] Finding literals rather than patterns in Lua - (2009-08-11)

U106 - Lua - Functions.
  [3695] Functions are first class variables in Lua and Python - (2012-04-13)
  [2949] Lua - variable function arguments and select - (2010-09-08)
  [2723] Returning multiple values from a function - Lua - (2010-04-15)
  [2455] Lua examples - coroutines, error handling, objects, etc - (2009-10-15)
  [2356] Passing multiple results back from a function - Lua, Python, etc - (2009-08-13)
  [2347] Dot, dot, dot in Lua - variable length parameter lists - (2009-08-11)
  [2312] What are closures in Lua? - (2009-07-31)
  [1847] Lua - IAQ (Infrequently Answered Questions) - (2008-10-18)
  [1743] First class functions in Lua lead to powerful OO facilities - (2008-08-07)
  [1697] Sorting in lua - specifying your own sort routine - (2008-07-05)
  [1685] Short circuit evaluation (lazy operator) in Lua - (2008-06-22)

U108 - Lua - Pattern matching
  [3687] Binary / bitwise operations in Lua with the standard bit32 library - (2012-04-06)
  [2727] Making a Lua program run more than 10 times faster - (2010-04-16)
  [2702] First and last match with Regular Expressions - (2010-04-02)
  [2383] Lua Regular Expressions - (2009-08-28)

U110 - Lua - Input / Output
  [3558] Python or Lua - which should I use / learn? - (2011-12-21)
  [2344] Reading a data file and sensing EOF in Lua - (2009-08-10)
  [1841] Formatting with a leading + / Lua and Perl - (2008-10-15)


Back to
First class functions in Lua lead to powerful OO facilities
Previous and next
or
Horse's mouth home
Forward to
Moodle, Drupal, Django (and Rails)
Some other Articles
Hotel room prices - Melksham, Wiltshire
Who is watching you?
London for the visitor, for free
Moodle, Drupal, Django (and Rails)
Lua examples, Lua Courses
Lua - Table elements v table as a whole
Age Concern
Vertical London
Bath, Snake or Nag?
4292 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, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 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).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/1744_Lua ... urses.html • PAGE BUILT: Thu Sep 18 15:30:25 2014 • BUILD SYSTEM: WomanWithCat