Run code in the Lua language

3

I downloaded the Lua interpreter, I created a hello.lua file with the following code:

print("Hello World")

But I can not compile this code and display the output. I downloaded version 5.3.3 and executed the file lua.exe , the console is displayed and typed: lua hello.lua , but the error below is displayed:

Detail,theexecutionofthedirectcodeintheconsoleworks,thatis,ifItypeprint("hello world") the return is hello world . But what I want is to run through a file.

    
asked by anonymous 13.11.2016 / 20:49

1 answer

5

You can do:

dofile("hello.lua")

Or you can exit the interpreter and run it directly

lua hello.lua
    
13.11.2016 / 21:04