Skip to content

Instantly share code, notes, and snippets.

@efruchter
Created June 5, 2013 20:48
Show Gist options
  • Save efruchter/5717208 to your computer and use it in GitHub Desktop.
Save efruchter/5717208 to your computer and use it in GitHub Desktop.
A simple intro to the Lua language, with everybody's favorite program, Hello World! Credit goes to Corsix.org.
_={_=_G}for--[[]]__--[[]]in(next),_["_"]do(_)[_]=(__)_[#_[_]],_[_[_]:byte(-#"#"
)+#_[_]-(#{}+#"(#''"*#"*#*#*"*#"_[_[]]")]=_[_],_[_]end(_)[_]=_._[_[#""]]{[_._[_
[#""]]]=_}_[""]=_._[_._[_[#[=[=#=]=]*-((#[=[#[=]#]=]))]](_._[_[-#[[_[-#[#_[_]]]
](_))]_[";"]=_._[_[#"#"+(#")#^")^#"#^"]]_["'"]=[[sub]]_['"']=_[""][_["'"]]_["/"
]=[[/_)=.,[#"('*:^;+]]_["'"]=_[""][_['"'](_[-#[[=[=]=]]],-#",_",-#"..").._["'"]
]_["["]=_['"'](_[-#"#-]_"],#",",#{_}).._['"'](_[-#"-"],#",",#"#").._['"'](_[-(#
"^#^")^#"^#"],#"-",#"(").._['"'](_[#_[-#"#"]*-#"[#"],#_[-#"#"],#_[-#"#"]).._[''
..'"'](_[-#[[=[]=]]],#_["/"]/#_["/"],#"/").._['"'](_[-(#"#)-")^#[[""]]],-#"-,",
-#[=[[]]=])_["]"]=_['"'](_[-#_[-#"-"]],#",",#"#").._[";"](_["["]..[=[('\]=]..(#
'#).'*#',..]]'*#'",#"#",'-#'(').."')")().._['"'](_[-#_[-#"-"]],-#_[-#"-"]-#"-",
-#_[-#"-"])_['_']=_[";"](_["["]..'(_[""].'.._[";"](_["["]..[[('\]]..((#_["/"]+#
"'")*#"#*("*#"..").."')")().._['"'](_[#_[-#"_"]*#"[_"],-#"#-,",-#"(,").._['"'](
_[-#_["/"]],-#",",-#"(")..'(_["/"],...,#"#","")-#"#")')_[";"](_["'"](_["'"]([[]
#/#)[([;#.))."[,[:[:[+)/,#[+#)[:[.)))^)^#/#)[([;#.))."[,[:[:[+)/,#[+#)[:[.)))^]
]],"[^".._["/"].."]",""),"(.)(.)",_[";"]("_['.'],_['#']=...".._["["].."(_['']."
.._["]"].."(_['_'](...)*#_['/']+_['_'](_['#'])))")))(...)_={#{...},#{#{}},#"#"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment