![]() ![]() Prints to the screen (Can end with semicolon) print( "Hello World") -] - Variable names can't start with a number, but can contain letters, numbers - and underscores - Lua is dynamically typed based off of the data stored there - This is a string and it can be surrounded by ' or " name = "Derek" - Another way to print to the screen - Escape Sequences : \n \b \t \\ \" \' - Get the string size by proceeding it with a # io.write( "Size of string ", # name, "\n") - You can store any data type in a variable even after initialization name = 4 io.write( "My name is ", name, "\n") - Lua only has floating point numbers and this is the max number bigNum = 9223372036854775807 + 1 io.write( "Big Number ", bigNum, "\n") io.write( "Big Number ", type( bigNum), "\n") - Floats are precise up to 13 digits floatPrecision = 1.999999999999 + 0.0000000000005 io.write( floatPrecision, "\n") - We can create long strings and maintain white space longString = ] io.write( longString, "\n") - Combine Strings with.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |