Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Introducción en 5 minutos a Lua

Introducción en 5 minutos a Lua

Una presentación pequeña para el SuperHappyDevHouse acerca de Lua y cómo se compara con otros lenguajes

Jeduan Cornejo

July 28, 2013
Tweet

More Decks by Jeduan Cornejo

Other Decks in Technology

Transcript

  1. Lua local str = 'string' local num = 2 local

    table = { 'key' = num } local array = {num, num, num} local function foo() print 'hola' end Saturday, July 27, 13
  2. Lua for key, value in pairs(t) do print key print

    value end Saturday, July 27, 13
  3. Funciones de primer nivel local function foo() print 'hola!' end

    timer.performWithDelay(2000, foo) -- ... -- hola! Saturday, July 27, 13
  4. Lua (gotchas) foo() local function foo() print 'hola!' end --

    attempt to call global 'foo' (a nil value) Saturday, July 27, 13
  5. Async function volcan( interface, callback ) setTimeout(function(){ start_eruption() setTimeout(function() {

    rumble_sound() callback(); }, 3000) }, 5000) end Saturday, July 27, 13
  6. Dónde seguir Learn Lua in 15 minutes http://tylerneylon.com/a/learn-lua/ Programming in

    Lua http://www.lua.org/pil/ brew install lua @jeduan Saturday, July 27, 13