Reader small image

You're reading from  Lua Quick Start Guide

Product typeBook
Published inJul 2018
Reading LevelBeginner
PublisherPackt
ISBN-139781789343229
Edition1st Edition
Languages
Right arrow
Author (1)
Gabor Szauer
Gabor Szauer
author image
Gabor Szauer

Gabor Szauer has been making games since 2010. He graduated from Full Sail University in 2010 with a bachelor's degree in game development. Gabor maintains an active Twitter presence, and maintains a programming-oriented game development blog. Gabor's previously published books are Game Physics Programming Cookbook and Lua Quick Start Guide, both published by Packt.
Read more about Gabor Szauer

Right arrow

Basic types

In the last section, you were introduced to the concepts of a variable and a value. This section explores the concept of what a value is. Every value has a data type, which intuitively describes what kind of data the value holds. Lua supports eight basic value types:

  • nil: The absence of data. This type represents literal nothingness. If a certain piece of data is invalid or unknown, nil is usually the best way to represent that it is invalid or unknown.
  • Boolean: A value of true or false. A Boolean value is binary and can only ever be in one of two states, true or false.
  • number: A number can represent any real number: 0, -1, 5, or even decimals such as 3.14159265359.
  • string: A string is an array of characters. When declaring a string literal, it must be "enclosed within quotation marks."
  • function: A function is some code that is referred to by a name and...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Lua Quick Start Guide
Published in: Jul 2018Publisher: PacktISBN-13: 9781789343229

Author (1)

author image
Gabor Szauer

Gabor Szauer has been making games since 2010. He graduated from Full Sail University in 2010 with a bachelor's degree in game development. Gabor maintains an active Twitter presence, and maintains a programming-oriented game development blog. Gabor's previously published books are Game Physics Programming Cookbook and Lua Quick Start Guide, both published by Packt.
Read more about Gabor Szauer