Pure Lua under MAC (i)

Source: Internet
Author: User
Tags lua

About Lua

What is Lua-lua is a cross-platform development scripting language.

Lua history

School University of Rio de Janeiro

Country Brazil

Author Roberto ierusalimschy,luiz Henrique Figueiredo Waldemar celes

Group of computer Graphics groups

Company Petrobas

Growth data-entry-language= "sol==" Lua

Lua Time Line

1993-Create

1996-dr. Dobbs's article mentions Lua, which is known by the world

Getting Started with Lua

Basic framework: Platform-OPENGL-Application Layer-framework-LUA code and resources

Set up Lua

Official website: http://www.lua.org

Mac and iOS

Mac comes with

IOS Iluabox,lua Console

LUA features

LUA is implemented as a library of C, and the language itself has no entrance

LUA variables

Alphanumeric underline, the first digit cannot be a number

Key words

And break does else ElseIf end false for function if in local nil not or repeat return to true until while

Hello,lua

MAC Shell Input Lua return

message = "Hello,lua"

Print ("Hello lua")

> Print (1,2,3,4,5, "one")

Output is 1 2 3 4 5 One

String

Escape character \b \ r \ \v \ \ \ \ \ \ \ \ \ \ \ \ \

message = [[My name is John]]

message = ' My name is John ';

message = "My name is John"

Values and Types

define int i; Dim i As Variant;

Type

Nil Null Boolean Boolean value number string string function function UserData c allocated memory block thread thread table

First class functions functions as function arguments

Code blocks and Scopes

Global Local

LUA operators

Arithmetic operator +-*/% (remainder) ^ (exponent)-(negative)

relational operators = = ~= < > <= >=

logical operator and OR not

Connection symbol:

Length Symbol #

Print (# "This is a test");//Draw string length

Pure Lua under MAC (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.