title
Lua Tutorial

description
Get the Cheat Sheet Here : http://goo.gl/0j15W0 Subscribe to Me: http://bit.ly/2FWQZTx Best Lua Book : http://amzn.to/2yYX5im ❇️ LIVESTREAMS : https://www.twitch.tv/derekbanas ❇️ DISCORD : https://discord.gg/2dkDmpVvgD ( Contact Me Anytime ) MY UDEMY COURSES ARE 87.5% OFF TIL December 19th ($9.99) ONE IS FREE ➡️ Python Data Science Series for $9.99 : Highest Rated & Largest Python Udemy Course + 56 Hrs + 200 Videos + Data Science https://bit.ly/Master_Python_41 ➡️ C++ Programming Bootcamp Series for $9.99 : Over 23 Hrs + 53 Videos + Quizzes + Graded Assignments + New Videos Every Month https://bit.ly/C_Course_41 ➡️ FREE 15 hour Golang Course!!! : https://bit.ly/go-tutorial3 Intro 00:00 Data Types 3:43 Math 6:58 Conditionals 10:53 Ternary Operator 15:20 Strings 16:35 Looping 19:11 Repeat Until 20:44 User Input 20:56 For 22:00 For In 22:29 Tables 23:41 Functions 28:26 Return Multiple Values 29:25 Variadic Functions 33:13 Closure 34:27 Coroutines 36:46 File I/O 40:10 Modules 43:32 Metatables 45:30 OOP 51:00 Inheritance 55:04 Like the channel? Consider becoming a Patreon! Check it out here: ►► https://www.patreon.com/derekbanas *Watch More Learn in One Videos* ►► Java - https://youtu.be/n-xAqcBCws4 ►► C++ - https://youtu.be/Rub-JsjMhWY ►► Python - https://youtu.be/N4mEzFDjqtA ►► MySQL - https://youtu.be/yPu6qV5byu4 ►► PHP - https://youtu.be/7TF00hJI78Y ►► Kotlin - https://youtu.be/H_oGi8uuDpA ►► C# - https://youtu.be/lisiwUZJXqQ ►► JavaScript - https://youtu.be/fju9ii8YsGs

detail
{'title': 'Lua Tutorial', 'heatmap': [{'end': 1413.516, 'start': 1342.743, 'weight': 0.719}, {'end': 2108.399, 'start': 2027.928, 'weight': 0.836}, {'end': 2726.612, 'start': 2615.582, 'weight': 0.719}], 'summary': "Tutorial 'lua tutorial' covers lua programming fundamentals, python math functions, lua programming concepts, lua functions and their usage, fileio and lua modules, and lua's metatables and oop, including topics like variable naming, conditional statements, string operations, and file operations.", 'chapters': [{'end': 598.091, 'segs': [{'end': 102.541, 'src': 'embed', 'start': 76.74, 'weight': 1, 'content': [{'end': 81.585, 'text': "just that simple, save that jump over here, and this is how we're going to execute our programs.", 'start': 76.74, 'duration': 4.845}, {'end': 85.708, 'text': 'just Lua and then the name of your Lua file and boom, hello world.', 'start': 81.585, 'duration': 4.123}, {'end': 87.489, 'text': 'so hello world is out of the way.', 'start': 85.708, 'duration': 1.781}, {'end': 89.731, 'text': 'that is how you would print to the terminal.', 'start': 87.489, 'duration': 2.242}, {'end': 96.737, 'text': "now you're going to be able to make comments just like this, or you can make multi-line comments like this.", 'start': 89.731, 'duration': 7.006}, {'end': 98.499, 'text': 'you can see how they popped up right there.', 'start': 96.737, 'duration': 1.762}, {'end': 99.92, 'text': 'so multi-line.', 'start': 98.499, 'duration': 1.421}, {'end': 102.541, 'text': 'and, and there we go, comments are out of the way.', 'start': 99.92, 'duration': 2.621}], 'summary': "Executing lua programs is simple: use 'lua' followed by file name. print to terminal, add single or multi-line comments.", 'duration': 25.801, 'max_score': 76.74, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs76740.jpg'}, {'end': 145.571, 'src': 'embed', 'start': 117.83, 'weight': 2, 'content': [{'end': 123.413, 'text': 'so this automatically becomes a string, because this is a string right here and your strings, of course,', 'start': 117.83, 'duration': 5.583}, {'end': 127.755, 'text': "can either be double quotes or you could have them be single quotes, doesn't really matter.", 'start': 123.413, 'duration': 4.342}, {'end': 133.6, 'text': 'Another way for you to be able to print stuff out in Lua is to go right like this.', 'start': 127.915, 'duration': 5.685}, {'end': 137.103, 'text': 'And you could say something like size of string.', 'start': 133.961, 'duration': 3.142}, {'end': 140.567, 'text': 'And then you could separate that if you wanted to put the string inside of here.', 'start': 137.344, 'duration': 3.223}, {'end': 145.571, 'text': "And on top of that, let's say that we also want to get the size or number of characters in our strings.", 'start': 140.947, 'duration': 4.624}], 'summary': 'Lua strings can be printed and their size can be calculated.', 'duration': 27.741, 'max_score': 117.83, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs117830.jpg'}, {'end': 237.032, 'src': 'embed', 'start': 211.172, 'weight': 0, 'content': [{'end': 216.416, 'text': 'We could then come in here and say something like my name is and name like that.', 'start': 211.172, 'duration': 5.244}, {'end': 218.438, 'text': 'And you can see my name is 4 comes out there.', 'start': 216.617, 'duration': 1.821}, {'end': 219.339, 'text': 'No errors are thrown.', 'start': 218.478, 'duration': 0.861}, {'end': 221.581, 'text': 'Other programming languages would throw errors, however.', 'start': 219.399, 'duration': 2.182}, {'end': 226.265, 'text': 'Now Lua only has floating point numbers or what they call just simple numbers.', 'start': 221.781, 'duration': 4.484}, {'end': 232.368, 'text': 'And the biggest integer that you could store inside of Lua is this gigantic guy right here.', 'start': 226.824, 'duration': 5.544}, {'end': 237.032, 'text': "And if we can go and add one to that, you're going to see that indeed that is true.", 'start': 232.909, 'duration': 4.123}], 'summary': 'Lua can handle large integers and floating point numbers without errors.', 'duration': 25.86, 'max_score': 211.172, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs211172.jpg'}, {'end': 289.596, 'src': 'embed', 'start': 265.179, 'weight': 3, 'content': [{'end': 271.725, 'text': 'now, as we all know, floating point numbers or, as some of us know anyway, floating point numbers are not necessarily precise.', 'start': 265.179, 'duration': 6.546}, {'end': 273.947, 'text': "so let's come in here and check the precision.", 'start': 271.725, 'duration': 2.222}, {'end': 280.132, 'text': "basically, with a floating point number, you're going to have your digits be precise, up to 13 digits.", 'start': 273.947, 'duration': 6.185}, {'end': 289.596, 'text': 'so that just means like this 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, like that, And then we could come in and add another digit to it.', 'start': 280.132, 'duration': 9.464}], 'summary': 'Floating point numbers are precise up to 13 digits.', 'duration': 24.417, 'max_score': 265.179, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs265179.jpg'}, {'end': 429.347, 'src': 'embed', 'start': 390.198, 'weight': 4, 'content': [{'end': 395.823, 'text': "so let's come in here and let's try to get a type of made up variable.", 'start': 390.198, 'duration': 5.625}, {'end': 400.406, 'text': 'so made up variable has been basically just created right there in that line.', 'start': 395.823, 'duration': 4.583}, {'end': 402.067, 'text': "it's not been defined with any value.", 'start': 400.406, 'duration': 1.661}, {'end': 410.954, 'text': "and you're going to see right here that everything in lua by default gets the value of nil if it does not get a value assigned specifically by you inside of your code.", 'start': 402.067, 'duration': 8.887}, {'end': 414.617, 'text': "so there's a rundown of a lot of what you need to know about variables.", 'start': 410.954, 'duration': 3.663}, {'end': 417.059, 'text': "now let's go and take a look at some math functions.", 'start': 414.617, 'duration': 2.442}, {'end': 419.721, 'text': 'Okay, so basic math functions we have in Lua.', 'start': 417.719, 'duration': 2.002}, {'end': 423.423, 'text': 'we can add, subtract, multiply, divide and this is the modulus.', 'start': 419.721, 'duration': 3.702}, {'end': 429.347, 'text': "And let's just go ahead and save that and execute it, and you're going to see exactly the results we're able to produce here.", 'start': 423.884, 'duration': 5.463}], 'summary': 'Introduction to creating variables and using basic math functions in lua.', 'duration': 39.149, 'max_score': 390.198, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs390198.jpg'}], 'start': 0.129, 'title': 'Lua programming fundamentals', 'summary': 'Covers the installation of lua, variable naming, basic coding, data types, and precision of floating point numbers. it also explains lua variables, math functions, usage, and limitations, including strings, booleans, nil values, and various mathematical operations.', 'chapters': [{'end': 317.217, 'start': 0.129, 'title': 'Lua programming tutorial', 'summary': 'Covers the installation of lua, writing basic code, variable naming, printing, data types, and precision of floating point numbers within lua programming language.', 'duration': 317.088, 'highlights': ['Lua tutorial covering installation, basic code writing, variable naming, printing, data types, and precision of floating point numbers.', 'Installation: Instructions provided for installing Lua on different operating systems.', "Code Writing: Demonstrated the process of writing and executing a basic 'Hello World' program in Lua.", 'Variable Naming: Explained the rules for naming variables in Lua, including dynamic typing based on variable content.', 'Printing: Illustrated different ways to print output in Lua, including string size and number of characters.', 'Data Types: Covered the concept of dynamically typed variables and the ability to convert variable types.', 'Floating Point Number Precision: Detailed the precision of floating point numbers in Lua, up to 13 digits.', 'String Creation: Discussed creating strings that span multiple lines in Lua.']}, {'end': 598.091, 'start': 317.557, 'title': 'Lua variables and math functions', 'summary': 'Covers lua variables, including strings, booleans, and nil values, and basic math functions such as addition, subtraction, multiplication, division, modulus, floor, ceiling, max, min, power, square root, and random number generation, detailing their usage and limitations.', 'duration': 280.534, 'highlights': ['The chapter covers Lua variables, including strings, booleans, and nil values. It details the usage and characteristics of Lua variables, including strings, booleans, and nil values, and highlights the behavior of variables when not explicitly assigned a value.', 'Basic math functions such as addition, subtraction, multiplication, division, modulus, floor, ceiling, max, min, power, square root, and random number generation are explained. It explains the usage and limitations of basic math functions in Lua, including addition, subtraction, multiplication, division, modulus, floor, ceiling, max, min, power, square root, and random number generation, emphasizing the differences from common shorthand notations in other languages.']}], 'duration': 597.962, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs129.jpg', 'highlights': ['Covers the installation of lua, variable naming, basic coding, data types, and precision of floating point numbers.', "Demonstrated the process of writing and executing a basic 'Hello World' program in Lua.", 'Illustrated different ways to print output in Lua, including string size and number of characters.', 'Detailed the precision of floating point numbers in Lua, up to 13 digits.', 'The chapter covers Lua variables, including strings, booleans, and nil values.', 'Explains the usage and limitations of basic math functions in Lua, including addition, subtraction, multiplication, division, modulus, floor, ceiling, max, min, power, square root, and random number generation.']}, {'end': 961.266, 'segs': [{'end': 645.499, 'src': 'embed', 'start': 617.05, 'weight': 0, 'content': [{'end': 625.666, 'text': "and then we wanted to import directly into our string a value, and let's say that we wanted it to be 10 decimal places long f.", 'start': 617.05, 'duration': 8.616}, {'end': 632.202, 'text': 'for float right like this, and we could also get the value of pi by calling the math library right like this,', 'start': 625.666, 'duration': 6.536}, {'end': 637.469, 'text': "you're going to see that we got the value of pi to 10 digits, automatically sorted out for us also.", 'start': 632.202, 'duration': 5.267}, {'end': 645.499, 'text': "however, be aware that this is only going to have a precision of 13 digits, anything over that, and it's going to start botching itself up.", 'start': 637.469, 'duration': 8.03}], 'summary': 'Import values with 10 decimal places, get pi to 10 digits precision, but precision limit is 13 digits.', 'duration': 28.449, 'max_score': 617.05, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs617050.jpg'}, {'end': 679.634, 'src': 'embed', 'start': 653.815, 'weight': 1, 'content': [{'end': 660.26, 'text': "Okay, whenever we're using conditional statements, we're going to have relational operators as well as logical operators.", 'start': 653.815, 'duration': 6.445}, {'end': 666.044, 'text': 'And the relational operators are going to be greater than, less than, greater than or equal to, less than or equal to.', 'start': 660.48, 'duration': 5.564}, {'end': 667.606, 'text': 'This is the funky one.', 'start': 666.064, 'duration': 1.542}, {'end': 668.466, 'text': "Well, that's fine.", 'start': 667.686, 'duration': 0.78}, {'end': 669.187, 'text': "That's just equal.", 'start': 668.506, 'duration': 0.681}, {'end': 672.709, 'text': 'But not equal is actually going to be tilde and equal to.', 'start': 669.367, 'duration': 3.342}, {'end': 674.251, 'text': 'Very important to remember that.', 'start': 673.01, 'duration': 1.241}, {'end': 675.872, 'text': 'Just tilde and equal to.', 'start': 674.371, 'duration': 1.501}, {'end': 679.634, 'text': 'this one right here, which you may be aware of, is not used,', 'start': 676.232, 'duration': 3.402}], 'summary': 'Using relational operators in conditional statements. tilde and equal to for not equal.', 'duration': 25.819, 'max_score': 653.815, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs653815.jpg'}, {'end': 796.452, 'src': 'embed', 'start': 770.691, 'weight': 3, 'content': [{'end': 777.037, 'text': 'Another thing that we have to remember is anytime we have an if statement, we always want to use end there whenever it is finished.', 'start': 770.691, 'duration': 6.346}, {'end': 781.682, 'text': "Now let's jump back to this guy as well as also check out exactly what goes on here.", 'start': 777.297, 'duration': 4.385}, {'end': 786.086, 'text': 'If we would go print like this and we would go local variable.', 'start': 781.962, 'duration': 4.124}, {'end': 787.447, 'text': "You're going to see what happens here.", 'start': 786.306, 'duration': 1.141}, {'end': 788.447, 'text': "Let's load this.", 'start': 787.647, 'duration': 0.8}, {'end': 791.549, 'text': 'You can go to school, but this comes back as nil.', 'start': 788.708, 'duration': 2.841}, {'end': 796.452, 'text': 'Like I said, once you define a variable inside of here, a local variable,', 'start': 791.769, 'duration': 4.683}], 'summary': "Using 'end' after an if statement is crucial for completion, and defining local variables impacts their scope.", 'duration': 25.761, 'max_score': 770.691, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs770691.jpg'}, {'end': 885.784, 'src': 'embed', 'start': 857.789, 'weight': 2, 'content': [{'end': 860.289, 'text': 'now you can do this, but it kind of gets sloppy.', 'start': 857.789, 'duration': 2.5}, {'end': 861.43, 'text': 'so watch out there.', 'start': 860.289, 'duration': 1.141}, {'end': 867.172, 'text': 'just wanted to demonstrate how the logical operator works and also make you aware that you may see people use really sloppy,', 'start': 861.43, 'duration': 5.742}, {'end': 868.452, 'text': 'long statements like that.', 'start': 867.172, 'duration': 1.28}, {'end': 875.68, 'text': "Now we're going to also be able to come in here and format or convert from multiple different variable types to other different variable types.", 'start': 868.697, 'duration': 6.983}, {'end': 880.722, 'text': "So let's just come in here and go print and string and then use format again.", 'start': 876.04, 'duration': 4.682}, {'end': 884.164, 'text': "And I'm going to demonstrate the not logical operator as well.", 'start': 881.202, 'duration': 2.962}, {'end': 885.784, 'text': "So let's say not true.", 'start': 884.444, 'duration': 1.34}], 'summary': 'Demonstration of logical and not operators, variable type conversion.', 'duration': 27.995, 'max_score': 857.789, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs857789.jpg'}, {'end': 936.411, 'src': 'embed', 'start': 912.982, 'weight': 4, 'content': [{'end': 920.507, 'text': 'You can also see how the boolean value, this guy right here, was converted to a string so we could use it inside of our print statement.', 'start': 912.982, 'duration': 7.525}, {'end': 923.589, 'text': 'Now there is no ternary operator inside of Lua.', 'start': 920.527, 'duration': 3.062}, {'end': 928.112, 'text': 'And a ternary operator normally looks like something like canVote is equal to age.', 'start': 923.93, 'duration': 4.182}, {'end': 933.411, 'text': 'greater than 18, like this, and otherwise false.', 'start': 929.11, 'duration': 4.301}, {'end': 936.411, 'text': "That's what a ternary operator looks like in other programming languages.", 'start': 933.531, 'duration': 2.88}], 'summary': 'Demonstrating conversion of boolean value to string for use in print statement in lua, absence of ternary operator in lua compared to other languages.', 'duration': 23.429, 'max_score': 912.982, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs912982.jpg'}], 'start': 598.191, 'title': 'Python math functions and lua programming', 'summary': "Covers formatting float values, importing math library, using conditional statements, relational and logical operators, and local variables in python, demonstrating precision, value manipulation, and syntax usage. additionally, it explores the usage of if statements with 'end', logical operators such as 'or', 'and', 'not', and the inability to use a ternary operator in lua.", 'chapters': [{'end': 769.87, 'start': 598.191, 'title': 'Python math functions and conditional statements', 'summary': 'Covers formatting float values, importing math library, using conditional statements, relational and logical operators, and local variables in python, demonstrating precision, value manipulation, and syntax usage.', 'duration': 171.679, 'highlights': ['Demonstrates formatting float values with precision of 10 decimal places and importing math library to get the value of pi. precision of 10 decimal places', 'Explains relational and logical operators, including greater than, less than, equal to, not equal to, and, or, not. relational and logical operators', 'Illustrates the usage of conditional statements with if, else if, and else, demonstrating their syntax and functionality. usage of conditional statements']}, {'end': 961.266, 'start': 770.691, 'title': 'Lua programming: logical operators and variable types', 'summary': "Covers the usage of if statements with 'end', logical operators such as 'or', 'and', 'not', and the inability to use a ternary operator in lua.", 'duration': 190.575, 'highlights': ["The chapter emphasizes the importance of using 'end' with if statements and explains the limitation of accessing a local variable outside of the if statement.", "The chapter demonstrates the usage of logical operators 'or', 'and', and 'not' in Lua, showcasing examples of their functionality and output.", 'The chapter explains the absence of a ternary operator in Lua and provides an alternative approach using logical operators to achieve similar functionality.']}], 'duration': 363.075, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs598191.jpg', 'highlights': ['Demonstrates formatting float values with precision of 10 decimal places and importing math library to get the value of pi.', 'Explains relational and logical operators, including greater than, less than, equal to, not equal to, and, or, not.', 'Illustrates the usage of conditional statements with if, else if, and else, demonstrating their syntax and functionality.', "The chapter emphasizes the importance of using 'end' with if statements and explains the limitation of accessing a local variable outside of the if statement.", "The chapter demonstrates the usage of logical operators 'or', 'and', and 'not' in Lua, showcasing examples of their functionality and output.", 'The chapter explains the absence of a ternary operator in Lua and provides an alternative approach using logical operators to achieve similar functionality.']}, {'end': 1760.527, 'segs': [{'end': 1017.27, 'src': 'embed', 'start': 978.461, 'weight': 0, 'content': [{'end': 986.447, 'text': "So there's an example of how we can use conditional statements or if, else, and else, as well as knock off a ternary operator.", 'start': 978.461, 'duration': 7.986}, {'end': 991.251, 'text': "And it's also good to know that there is no such thing as switch inside of Lua.", 'start': 986.588, 'duration': 4.663}, {'end': 994.854, 'text': 'But you can also basically knock that off with if and else statements.', 'start': 991.432, 'duration': 3.422}, {'end': 999.058, 'text': "Now let's go and take a look at some strings and ways that we can work with them.", 'start': 995.255, 'duration': 3.803}, {'end': 1005.64, 'text': 'okay. so i went and created a really, really long string right here for us to be able to play around with,', 'start': 999.915, 'duration': 5.725}, {'end': 1012.026, 'text': "and i'm just going to do a couple simple little string operations that are common and then, as the tutorial continues, i'll cover some more.", 'start': 1005.64, 'duration': 6.386}, {'end': 1016.55, 'text': "so let's go and say that we wanted to do something like get the quote length right.", 'start': 1012.026, 'duration': 4.524}, {'end': 1017.27, 'text': 'like this.', 'start': 1016.55, 'duration': 0.72}], 'summary': 'Using conditional statements and string operations in lua for programming.', 'duration': 38.809, 'max_score': 978.461, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs978461.jpg'}, {'end': 1215.34, 'src': 'embed', 'start': 1190.788, 'weight': 3, 'content': [{'end': 1197.591, 'text': "And then let's also say that we would want to jump completely out of this loop and not continue looping through it anymore.", 'start': 1190.788, 'duration': 6.803}, {'end': 1206.276, 'text': "If, for example, i has a value of 8, well, then we're going to say something like break and of course we have to put an end right there.", 'start': 1197.911, 'duration': 8.365}, {'end': 1212.319, 'text': "that's going to end our if statement, but then we're going to need another end that is actually going to end our while loop,", 'start': 1206.276, 'duration': 6.043}, {'end': 1215.34, 'text': 'and then we could do something like print and throw a new line in there.', 'start': 1212.319, 'duration': 3.021}], 'summary': 'Demonstrating how to break out of a loop with an example of i having a value of 8.', 'duration': 24.552, 'max_score': 1190.788, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs1190788.jpg'}, {'end': 1269.992, 'src': 'embed', 'start': 1246.726, 'weight': 4, 'content': [{'end': 1253.488, 'text': "So we're going to say repeat, and we're going to continue to execute code inside of here as long as a condition is true.", 'start': 1246.726, 'duration': 6.762}, {'end': 1258.129, 'text': "And let's come in here and also demonstrate exactly how you can get user input from somebody.", 'start': 1253.728, 'duration': 4.401}, {'end': 1261.19, 'text': "So let's say enter your guess like that.", 'start': 1258.149, 'duration': 3.041}, {'end': 1263.131, 'text': 'We could then come down and store.', 'start': 1261.39, 'duration': 1.741}, {'end': 1269.992, 'text': 'inside of the variable guess, whatever they enter in the keyboard, and that is how easy it is to get keyboard input.', 'start': 1263.57, 'duration': 6.422}], 'summary': 'Demonstrates repeat loop and obtaining user input.', 'duration': 23.266, 'max_score': 1246.726, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs1246726.jpg'}, {'end': 1413.516, 'src': 'heatmap', 'start': 1342.743, 'weight': 0.719, 'content': [{'end': 1345.184, 'text': 'And you can go ahead and check out exactly how that would work.', 'start': 1342.743, 'duration': 2.441}, {'end': 1349.086, 'text': 'And you can see it just cycled through there and printed out one through 10 right on our screen.', 'start': 1345.224, 'duration': 3.862}, {'end': 1353.929, 'text': "Now what I'm going to do is, this is a table which we're going to talk more about here in a second,", 'start': 1349.286, 'duration': 4.643}, {'end': 1356.831, 'text': "but it's basically like an array and other programming languages.", 'start': 1353.929, 'duration': 2.902}, {'end': 1362.362, 'text': "It's just going to be a variable that's going to allow us to store multiple different values inside of it.", 'start': 1357.341, 'duration': 5.021}, {'end': 1368.424, 'text': 'And I jumped ahead to this right now because I want to show you how easy it is to cycle through all of these different tables.', 'start': 1362.642, 'duration': 5.782}, {'end': 1372.945, 'text': "So here we'll just go for and then we'll say key K for the key.", 'start': 1368.804, 'duration': 4.141}, {'end': 1375.066, 'text': "Let's just call it key just so you can see.", 'start': 1373.145, 'duration': 1.921}, {'end': 1382.448, 'text': "And value because everything in a table is going to have a key or a value or it's going to have an index by default if you do not assign a key.", 'start': 1375.326, 'duration': 7.122}, {'end': 1384.53, 'text': 'And we could say something like pairs.', 'start': 1382.988, 'duration': 1.542}, {'end': 1385.551, 'text': "Pairs doesn't matter.", 'start': 1384.73, 'duration': 0.821}, {'end': 1387.113, 'text': 'You can put anything you want inside here.', 'start': 1385.591, 'duration': 1.522}, {'end': 1388.474, 'text': "It doesn't matter what the name of that is.", 'start': 1387.133, 'duration': 1.341}, {'end': 1389.696, 'text': 'And we could say months.', 'start': 1388.755, 'duration': 0.941}, {'end': 1391.678, 'text': 'And then we could say do like this.', 'start': 1390.016, 'duration': 1.662}, {'end': 1396.683, 'text': 'And then we could cycle through our table just like we did cycling through indexes.', 'start': 1391.998, 'duration': 4.685}, {'end': 1400.567, 'text': "And let's just say in this situation, we just want to print our values out to the screen.", 'start': 1396.943, 'duration': 3.624}, {'end': 1403.611, 'text': 'And of course, we have to end our for loop right like this.', 'start': 1400.828, 'duration': 2.783}, {'end': 1408.093, 'text': 'and, of course, make sure that we put value inside of there and not v, and if we execute it,', 'start': 1404.091, 'duration': 4.002}, {'end': 1413.516, 'text': "you're going to see that it prints out all of the different months, with a space in between each one of those months,", 'start': 1408.093, 'duration': 5.423}], 'summary': 'Demonstration of cycling through a table and printing multiple values.', 'duration': 70.773, 'max_score': 1342.743, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs1342743.jpg'}, {'end': 1413.516, 'src': 'embed', 'start': 1382.988, 'weight': 5, 'content': [{'end': 1384.53, 'text': 'And we could say something like pairs.', 'start': 1382.988, 'duration': 1.542}, {'end': 1385.551, 'text': "Pairs doesn't matter.", 'start': 1384.73, 'duration': 0.821}, {'end': 1387.113, 'text': 'You can put anything you want inside here.', 'start': 1385.591, 'duration': 1.522}, {'end': 1388.474, 'text': "It doesn't matter what the name of that is.", 'start': 1387.133, 'duration': 1.341}, {'end': 1389.696, 'text': 'And we could say months.', 'start': 1388.755, 'duration': 0.941}, {'end': 1391.678, 'text': 'And then we could say do like this.', 'start': 1390.016, 'duration': 1.662}, {'end': 1396.683, 'text': 'And then we could cycle through our table just like we did cycling through indexes.', 'start': 1391.998, 'duration': 4.685}, {'end': 1400.567, 'text': "And let's just say in this situation, we just want to print our values out to the screen.", 'start': 1396.943, 'duration': 3.624}, {'end': 1403.611, 'text': 'And of course, we have to end our for loop right like this.', 'start': 1400.828, 'duration': 2.783}, {'end': 1408.093, 'text': 'and, of course, make sure that we put value inside of there and not v, and if we execute it,', 'start': 1404.091, 'duration': 4.002}, {'end': 1413.516, 'text': "you're going to see that it prints out all of the different months, with a space in between each one of those months,", 'start': 1408.093, 'duration': 5.423}], 'summary': 'Demonstration of iterating through pairs and printing out months.', 'duration': 30.528, 'max_score': 1382.988, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs1382988.jpg'}, {'end': 1671.505, 'src': 'embed', 'start': 1638.39, 'weight': 6, 'content': [{'end': 1639.711, 'text': 'and then we can go end.', 'start': 1638.39, 'duration': 1.321}, {'end': 1646.123, 'text': "and then finally, and this for loop, now we're going to be able to come in and access the values that are stored inside of there,", 'start': 1639.711, 'duration': 6.412}, {'end': 1649.205, 'text': 'of course by using the indexes as well.', 'start': 1646.123, 'duration': 3.082}, {'end': 1658.831, 'text': "so let's say table and we wanted to get whatever is being stored at the index of zero, zero inside of our multi-dimensional array go like this,", 'start': 1649.205, 'duration': 9.626}, {'end': 1660.653, 'text': 'or all tight dimensional table.', 'start': 1658.831, 'duration': 1.822}, {'end': 1666.361, 'text': 'sorry about that and we can get zero, and zero like this, and you can see it comes back as 0..', 'start': 1660.653, 'duration': 5.708}, {'end': 1671.505, 'text': 'Of course, we could come in here and go 1 and 2, save that, and you get 1 and 2, right like that.', 'start': 1666.361, 'duration': 5.144}], 'summary': 'Demonstrates accessing values in a multi-dimensional array using indexes, with examples of accessing values at different indexes.', 'duration': 33.115, 'max_score': 1638.39, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs1638390.jpg'}], 'start': 961.266, 'title': 'Lua programming concepts', 'summary': 'Covers working with conditional statements like if, else, else if, and comparison to the ternary operator, and absence of switch statement in lua. it also includes string operations and looping concepts such as while, repeat-until, for loops, and working with tables and multi-dimensional arrays.', 'chapters': [{'end': 999.058, 'start': 961.266, 'title': 'Working with conditional statements in lua', 'summary': 'Explains how to use conditional statements in lua, including if, else, and else if, as well as a comparison to the ternary operator and the absence of a switch statement in lua.', 'duration': 37.792, 'highlights': ['The chapter demonstrates the use of conditional statements like if, else, and else if, as well as their similarity to the ternary operator.', 'It highlights the absence of a switch statement in Lua and the ability to achieve similar functionality using if and else statements.', 'The transcript briefly mentions working with strings in Lua without providing further details or examples.']}, {'end': 1760.527, 'start': 999.915, 'title': 'Lua string operations and looping', 'summary': 'Covers string operations like getting the length, replacing strings, finding indexes, converting to uppercase and lowercase, and looping concepts including while, repeat-until, for loops, and working with tables and multi-dimensional arrays.', 'duration': 760.612, 'highlights': ['Covered common string operations like getting the length, replacing strings, finding indexes, and converting to uppercase and lowercase. The tutorial covers string operations such as getting the length of a string, replacing specific strings, finding indexes of words, and converting strings to uppercase and lowercase.', 'Explained the concept of looping using while loop and demonstrated the use of break statement to exit the loop. The tutorial explains looping concepts using a while loop and demonstrates the usage of the break statement to exit the loop.', 'Introduced the repeat-until loop and demonstrated getting user input until a specific condition is met. The tutorial introduces the repeat-until loop and demonstrates how to continuously get user input until a specific condition is met.', "Explained for loops and demonstrated cycling through a table using the 'pairs' function. The chapter explains for loops and demonstrates cycling through a table using the 'pairs' function to access and print values.", 'Covered the concept of tables and multi-dimensional arrays, including populating and accessing values. The chapter covers tables and multi-dimensional arrays, including populating and accessing values using nested for loops and indexing.']}], 'duration': 799.261, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs961266.jpg', 'highlights': ['The chapter covers working with conditional statements like if, else, else if, and comparison to the ternary operator.', 'It highlights the absence of a switch statement in Lua and the ability to achieve similar functionality using if and else statements.', 'The tutorial covers string operations such as getting the length of a string, replacing specific strings, finding indexes of words, and converting strings to uppercase and lowercase.', 'The tutorial explains looping concepts using a while loop and demonstrates the usage of the break statement to exit the loop.', 'The tutorial introduces the repeat-until loop and demonstrates how to continuously get user input until a specific condition is met.', "The chapter explains for loops and demonstrates cycling through a table using the 'pairs' function to access and print values.", 'The chapter covers tables and multi-dimensional arrays, including populating and accessing values using nested for loops and indexing.']}, {'end': 2400.736, 'segs': [{'end': 2017.205, 'src': 'embed', 'start': 1989.152, 'weight': 0, 'content': [{'end': 1993.094, 'text': "so there's a whole bunch of different ways we can use functions inside of Lua.", 'start': 1989.152, 'duration': 3.942}, {'end': 1995.516, 'text': "let's go and talk about veratic functions.", 'start': 1993.094, 'duration': 2.422}, {'end': 2001.438, 'text': "this is how we're going to be able to receive an unknown number of parameters inside of our functions.", 'start': 1995.996, 'duration': 5.442}, {'end': 2005.479, 'text': "again. just create a function and let's just call this get some more.", 'start': 2001.438, 'duration': 4.041}, {'end': 2010.701, 'text': "if we don't know how many different parameters or attributes or whatever that could be sent inside here,", 'start': 2005.479, 'duration': 5.222}, {'end': 2017.205, 'text': "we're just going to put three little dots inside of there and we could do something like local sum is equal to zero.", 'start': 2010.701, 'duration': 6.504}], 'summary': 'Lua functions can handle unknown parameters using vararg functions.', 'duration': 28.053, 'max_score': 1989.152, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs1989152.jpg'}, {'end': 2108.399, 'src': 'heatmap', 'start': 2027.928, 'weight': 0.836, 'content': [{'end': 2034.43, 'text': "it's going to automatically just keep cycling through there, depending upon the number of attributes or parameters that were passed inside.", 'start': 2027.928, 'duration': 6.502}, {'end': 2038.771, 'text': 'then we go sum is equal to sum plus whatever value was passed inside.', 'start': 2034.43, 'duration': 4.341}, {'end': 2044.874, 'text': "of course, end that with an end And after it's done, go return the total sum and then close off the function.", 'start': 2038.771, 'duration': 6.103}, {'end': 2048.917, 'text': 'And then we could print all this out on a screen, call get some more.', 'start': 2045.014, 'duration': 3.903}, {'end': 2052.538, 'text': "You're going to be able to pass as many things in here as you could possibly ever want to.", 'start': 2048.937, 'duration': 3.601}, {'end': 2054.259, 'text': "Let's just keep it as six.", 'start': 2052.799, 'duration': 1.46}, {'end': 2055.9, 'text': 'And it gave me a little bit of an error.', 'start': 2054.699, 'duration': 1.201}, {'end': 2062.164, 'text': 'You can see right here get sum I can type in some more like that and there we go.', 'start': 2055.94, 'duration': 6.224}, {'end': 2063.465, 'text': 'sum is equal to 21.', 'start': 2062.164, 'duration': 1.301}, {'end': 2067.666, 'text': "so that's how we're able to pass in an unknown number of parameters and then use it.", 'start': 2063.465, 'duration': 4.201}, {'end': 2069.226, 'text': 'now another thing is kind of interesting.', 'start': 2067.666, 'duration': 1.56}, {'end': 2077.449, 'text': 'inside of Lua is a function is a variable in that we can store them under variable names as well as we store tables,', 'start': 2069.226, 'duration': 8.223}, {'end': 2080.11, 'text': 'and we can also pass and return them through function.', 'start': 2077.449, 'duration': 2.661}, {'end': 2081.29, 'text': "so let's demonstrate that.", 'start': 2080.11, 'duration': 1.18}, {'end': 2082.771, 'text': "let's say double it.", 'start': 2081.29, 'duration': 1.481}, {'end': 2083.67, 'text': 'there is a variable.', 'start': 2082.771, 'duration': 0.899}, {'end': 2086.433, 'text': 'We can actually put a function inside of this.', 'start': 2083.931, 'duration': 2.502}, {'end': 2089.636, 'text': "So let's say it gets a value of x.", 'start': 2086.773, 'duration': 2.863}, {'end': 2093.178, 'text': 'And then we can just say return x times 2.', 'start': 2089.636, 'duration': 3.542}, {'end': 2094.699, 'text': 'And then put the end function on there.', 'start': 2093.178, 'duration': 1.521}, {'end': 2098.543, 'text': 'So we have basically just made double it a function.', 'start': 2094.88, 'duration': 3.663}, {'end': 2100.384, 'text': 'It is a variable also, however.', 'start': 2098.703, 'duration': 1.681}, {'end': 2108.399, 'text': "You can see right here if we just go print and double it like this and then pass in a 4, it's automatically going to pop out an 8.", 'start': 2100.674, 'duration': 7.725}], 'summary': 'Demonstrating passing and using an unknown number of parameters in a function, and storing a function as a variable in lua.', 'duration': 80.471, 'max_score': 2027.928, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2027928.jpg'}, {'end': 2133.377, 'src': 'embed', 'start': 2108.399, 'weight': 3, 'content': [{'end': 2115.164, 'text': 'Now going along those same lines, a closure is a function that can access local variables of an enclosing function.', 'start': 2108.399, 'duration': 6.765}, {'end': 2116.885, 'text': "So let's go and let's create one.", 'start': 2115.224, 'duration': 1.661}, {'end': 2117.826, 'text': "So let's go function.", 'start': 2116.905, 'duration': 0.921}, {'end': 2124.471, 'text': "Let's just call this outer func because this is going to be an outer function that is going to contain our closure.", 'start': 2118.106, 'duration': 6.365}, {'end': 2126.852, 'text': "You're going to see exactly why this is interesting.", 'start': 2124.491, 'duration': 2.361}, {'end': 2130.635, 'text': "So let's create a local variable, i equal to 0.", 'start': 2127.133, 'duration': 3.502}, {'end': 2133.377, 'text': "and then let's put an inner function inside of it.", 'start': 2130.635, 'duration': 2.742}], 'summary': 'Creating a closure within an outer function to access local variables.', 'duration': 24.978, 'max_score': 2108.399, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2108399.jpg'}, {'end': 2407.581, 'src': 'embed', 'start': 2382.892, 'weight': 4, 'content': [{'end': 2389.354, 'text': 'And then whenever we call the coroutine to continue execution, you can see that it continues executing until it is finally dead.', 'start': 2382.892, 'duration': 6.462}, {'end': 2394.15, 'text': 'And you can see right here if we come in and get the status of this coroutine right here,', 'start': 2389.727, 'duration': 4.423}, {'end': 2398.534, 'text': 'it is in fact dead after it has done or executed all the code inside of it.', 'start': 2394.15, 'duration': 4.384}, {'end': 2400.736, 'text': "So there's an overview of coroutines.", 'start': 2398.754, 'duration': 1.982}, {'end': 2407.581, 'text': "Now let's take a look at something that a lot of people are confused about, because there's not much good information online about it,", 'start': 2400.856, 'duration': 6.725}], 'summary': 'Coroutines continue executing until dead, often confused due to lack of online information.', 'duration': 24.689, 'max_score': 2382.892, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2382892.jpg'}], 'start': 1760.527, 'title': 'Lua functions and their usage', 'summary': 'Covers lua functions, including creating, calling, and returning multiple values, and provides insights into string manipulation. it also explains closures, coroutines, and their implementation with examples of running multiple tasks concurrently.', 'chapters': [{'end': 2005.479, 'start': 1760.527, 'title': 'Lua functions and string manipulation', 'summary': 'Explains how to create and call functions in lua, including returning multiple values, and demonstrates how to split a string into a table, and cycle through the values, providing insights into string manipulation and function usage.', 'duration': 244.952, 'highlights': ['The chapter explains how to create and call functions in Lua, including returning multiple values.', 'It demonstrates how to split a string into a table and cycle through the values.', 'Provides insights into string manipulation and function usage, showcasing multiple ways to use functions inside of Lua.']}, {'end': 2400.736, 'start': 2005.479, 'title': 'Lua functions and coroutines', 'summary': 'Demonstrates how to handle unknown parameters in a lua function and explains the concepts of closures and coroutines, with examples of their implementation and functionalities, and also shows how coroutines can be used to run multiple tasks concurrently.', 'duration': 395.257, 'highlights': ['Demonstrating handling of unknown parameters in a Lua function The chapter illustrates a Lua function that can handle an unknown number of parameters, processing them to calculate the total sum and returning the result, showcasing the flexibility of the function to handle diverse inputs.', 'Explanation of closures and their functionality It explains the concept of closures in Lua, demonstrating how an inner function can remember and access changes made to the variables in the outer function, highlighting the practicality and behavior of closures in storing changing values.', 'Introduction to coroutines and their functionalities The chapter provides an overview of coroutines, likening them to threads in other programming languages, explaining their statuses of running, suspended, dead, or normal, and showcases the implementation of multiple coroutines to run tasks concurrently, emphasizing their ability to execute tasks in a cooperative manner.']}], 'duration': 640.209, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs1760527.jpg', 'highlights': ['The chapter provides insights into string manipulation and function usage, showcasing multiple ways to use functions inside of Lua.', 'The chapter explains how to create and call functions in Lua, including returning multiple values.', 'The chapter illustrates a Lua function that can handle an unknown number of parameters, processing them to calculate the total sum and returning the result, showcasing the flexibility of the function to handle diverse inputs.', 'The chapter explains the concept of closures in Lua, demonstrating how an inner function can remember and access changes made to the variables in the outer function, highlighting the practicality and behavior of closures in storing changing values.', 'The chapter provides an overview of coroutines, likening them to threads in other programming languages, explaining their statuses of running, suspended, dead, or normal, and showcases the implementation of multiple coroutines to run tasks concurrently, emphasizing their ability to execute tasks in a cooperative manner.']}, {'end': 2726.612, 'segs': [{'end': 2468.856, 'src': 'embed', 'start': 2441.451, 'weight': 0, 'content': [{'end': 2447.977, 'text': "if we want to create a new file that we're going to be working with, we just go io open right like this, and then we're going to give it a name.", 'start': 2441.451, 'duration': 6.526}, {'end': 2454.303, 'text': "let's say i call this test lua like that, and let's say that i want to have the opportunity to create a new file,", 'start': 2447.977, 'duration': 6.326}, {'end': 2459.508, 'text': "because i know this doesn't exist right now, and then i want to also be able to overwrite and read from that file.", 'start': 2454.303, 'duration': 5.205}, {'end': 2463.452, 'text': "So I'm going to just use that guy right there, because that works for all the things I want to be able to do.", 'start': 2459.909, 'duration': 3.543}, {'end': 2464.273, 'text': 'And there you go.', 'start': 2463.592, 'duration': 0.681}, {'end': 2468.856, 'text': "You just created a file and you're able to write to it and read from it and also make it.", 'start': 2464.293, 'duration': 4.563}], 'summary': 'Using io open to create and manipulate a new file in lua.', 'duration': 27.405, 'max_score': 2441.451, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2441451.jpg'}, {'end': 2541.105, 'src': 'embed', 'start': 2517.105, 'weight': 3, 'content': [{'end': 2523.748, 'text': "Okay, so we wrote to our file, we created our file, we jump back to the beginning of our file, and we're going to read everything from that point.", 'start': 2517.105, 'duration': 6.643}, {'end': 2526.089, 'text': 'Final thing we need to do is close our file.', 'start': 2524.028, 'duration': 2.061}, {'end': 2528.838, 'text': 'there we go and it popped up a little bit of an error.', 'start': 2526.497, 'duration': 2.341}, {'end': 2530.379, 'text': 'i keep the errors inside of here.', 'start': 2528.838, 'duration': 1.541}, {'end': 2534.441, 'text': 'just want to make sure we put our quotes inside of there, because i think whenever you see me make an error,', 'start': 2530.379, 'duration': 4.062}, {'end': 2541.105, 'text': "that's going to help you keep from making errors and you can see right there print it out random string of text and some more text right like that.", 'start': 2534.441, 'duration': 6.664}], 'summary': 'Demonstration of file manipulation, error handling, and printing string.', 'duration': 24, 'max_score': 2517.105, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2517105.jpg'}, {'end': 2726.612, 'src': 'heatmap', 'start': 2615.582, 'weight': 0.719, 'content': [{'end': 2624.144, 'text': "a module is like a library that is full of functions and variables and you're going to be able to create it and then use it inside of your program.", 'start': 2615.582, 'duration': 8.562}, {'end': 2626.465, 'text': "so let's go and let's create a module.", 'start': 2624.144, 'duration': 2.321}, {'end': 2636.687, 'text': "so we'll just come in here and go new file and I am going to save this guy using the name convert dot Lua, of course and then save that.", 'start': 2626.465, 'duration': 10.222}, {'end': 2638.108, 'text': "so let's create a module.", 'start': 2636.687, 'duration': 1.421}, {'end': 2649.59, 'text': "it's very important that your module name and your file name are exactly the same and to create one I'm gonna go local convert and the name of this guy and there is our module and then inside of this i can put a function.", 'start': 2638.108, 'duration': 11.482}, {'end': 2653.091, 'text': "let's say i want to do something like convert feet to centimeters.", 'start': 2649.59, 'duration': 3.501}, {'end': 2661.813, 'text': "so we'll go feet to centimeters and this function is going to receive an attribute of feet and then it is going to return whatever.", 'start': 2653.091, 'duration': 8.722}, {'end': 2663.853, 'text': 'that value is times 30.48.', 'start': 2661.813, 'duration': 2.04}, {'end': 2667.694, 'text': "i think that's right and end.", 'start': 2663.853, 'duration': 3.841}, {'end': 2672.652, 'text': "and then you also need to return the module and save it, and that is how we're going to do it.", 'start': 2667.694, 'duration': 4.958}, {'end': 2679.854, 'text': 'just make sure we have convert here, convert here and convert here very important and also the name of the file has to be converted or convert.', 'start': 2672.652, 'duration': 7.202}, {'end': 2684.356, 'text': "well, now we can come over and do something like convert module doesn't need to be named.", 'start': 2679.854, 'duration': 4.502}, {'end': 2689.418, 'text': 'convert module, name it whatever you want, and if you want to be able to get access to that, they have to be in the same directory.', 'start': 2684.356, 'duration': 5.062}, {'end': 2696.16, 'text': "of course we're going to say require and convert right like this, and then we'll be able to come in here and work with this module,", 'start': 2689.418, 'duration': 6.742}, {'end': 2700.802, 'text': "function like this, and then let's say that we want only three decimal places.", 'start': 2696.16, 'duration': 4.642}, {'end': 2704.584, 'text': "that's how we do that with a floating point number and there is centimeters.", 'start': 2700.802, 'duration': 3.782}, {'end': 2712.388, 'text': 'and then, if we want to call our module, just convert module, just like we created right there, and then follow that with feet to centimeters,', 'start': 2704.584, 'duration': 7.804}, {'end': 2719.132, 'text': 'which is the name of the function we have in the module, and we pass in a value of 12, and you can see it gets back the answer of 42.480 centimeters.', 'start': 2712.388, 'duration': 6.744}, {'end': 2726.612, 'text': "There's a quick example of how we can work with modules inside of Lua.", 'start': 2721.889, 'duration': 4.723}], 'summary': 'Creating and using a lua module with a function to convert feet to centimeters, achieving 42.480 centimeters.', 'duration': 111.03, 'max_score': 2615.582, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2615582.jpg'}, {'end': 2728.573, 'src': 'embed', 'start': 2704.584, 'weight': 1, 'content': [{'end': 2712.388, 'text': 'and then, if we want to call our module, just convert module, just like we created right there, and then follow that with feet to centimeters,', 'start': 2704.584, 'duration': 7.804}, {'end': 2719.132, 'text': 'which is the name of the function we have in the module, and we pass in a value of 12, and you can see it gets back the answer of 42.480 centimeters.', 'start': 2712.388, 'duration': 6.744}, {'end': 2726.612, 'text': "There's a quick example of how we can work with modules inside of Lua.", 'start': 2721.889, 'duration': 4.723}, {'end': 2728.573, 'text': "Now let's take a look at meta tables.", 'start': 2726.772, 'duration': 1.801}], 'summary': 'Using modules in lua to convert feet to centimeters, yielding 42.480 cm.', 'duration': 23.989, 'max_score': 2704.584, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2704584.jpg'}], 'start': 2400.856, 'title': 'Fileio and lua modules', 'summary': 'Covers operations on files using fileio in lua such as creating, overwriting, appending, reading, and closing files. it also discusses creating and using modules in lua, showcasing a custom feet to centimeters conversion module that returns the result of 12 feet being converted to 42.480 centimeters.', 'chapters': [{'end': 2598.459, 'start': 2400.856, 'title': 'Working with fileio in lua', 'summary': 'Explores various operations on files using fileio in lua, including creating, overwriting, appending, reading, and closing files, and also highlights the importance of error handling.', 'duration': 197.603, 'highlights': ['The chapter covers creating, overwriting, and appending files using FileIO in Lua.', 'It demonstrates the process of writing text to a file and using seek to move within the file, with examples of reading the file and error handling.', 'The importance of proper error handling is emphasized to prevent mistakes in file operations.']}, {'end': 2726.612, 'start': 2598.64, 'title': 'Working with lua modules', 'summary': 'Discusses creating and using modules in lua, demonstrating the conversion of feet to centimeters using a custom module, which returns the result of 12 feet being converted to 42.480 centimeters.', 'duration': 127.972, 'highlights': ["Creating a Lua module named 'convert' to convert feet to centimeters Demonstrates the process of creating a custom module in Lua named 'convert' to convert feet to centimeters, returning the result of 12 feet being converted to 42.480 centimeters.", "Explaining the usage of 'require' to access the custom module Explains the usage of 'require' to access the custom module created, enabling the function 'feet to centimeters' to be utilized for conversion, resulting in 42.480 centimeters when 12 feet is input.", 'Overview of working with modules inside Lua Provides a brief example of working with modules inside Lua, showcasing the creation and usage of a custom module to convert feet to centimeters, yielding 42.480 centimeters when 12 feet is input.']}], 'duration': 325.756, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2400856.jpg', 'highlights': ['The chapter covers creating, overwriting, and appending files using FileIO in Lua.', "Demonstrates the process of creating a custom module in Lua named 'convert' to convert feet to centimeters, returning the result of 12 feet being converted to 42.480 centimeters.", "Explains the usage of 'require' to access the custom module created, enabling the function 'feet to centimeters' to be utilized for conversion, resulting in 42.480 centimeters when 12 feet is input.", 'The importance of proper error handling is emphasized to prevent mistakes in file operations.']}, {'end': 3443.537, 'segs': [{'end': 2757.895, 'src': 'embed', 'start': 2726.772, 'weight': 1, 'content': [{'end': 2728.573, 'text': "Now let's take a look at meta tables.", 'start': 2726.772, 'duration': 1.801}, {'end': 2738.48, 'text': 'Now, a meta table is going to allow us to define how operations on tables should be carried out in regards to adding tables together, subtracting,', 'start': 2729.834, 'duration': 8.646}, {'end': 2742.423, 'text': 'multiplying, dividing, concatenating, comparing tables and so forth, and so on.', 'start': 2738.48, 'duration': 3.943}, {'end': 2745.625, 'text': "So let's come in and create a table and put some default values in it.", 'start': 2742.543, 'duration': 3.082}, {'end': 2749.908, 'text': "So I'm just going to go a table like this and create my little table.", 'start': 2745.825, 'duration': 4.083}, {'end': 2754.592, 'text': "And then I'm going to use a for loop to jump through here and just fill it up with stuff.", 'start': 2750.169, 'duration': 4.423}, {'end': 2757.895, 'text': "Let's just say 1 through 10, 2, and a table.", 'start': 2754.632, 'duration': 3.263}], 'summary': 'Meta tables define operations on tables with default values and a for loop to fill it up.', 'duration': 31.123, 'max_score': 2726.772, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2726772.jpg'}, {'end': 3013.907, 'src': 'embed', 'start': 2984.227, 'weight': 2, 'content': [{'end': 2986.588, 'text': "It's going to be something very, very similar to this guy right here.", 'start': 2984.227, 'duration': 2.361}, {'end': 2993.292, 'text': 'OK So now that we have our meta table all set up, we need to attach the meta methods to our table.', 'start': 2986.908, 'duration': 6.384}, {'end': 2996.294, 'text': 'How you do that is go set meta table.', 'start': 2993.472, 'duration': 2.822}, {'end': 2999.176, 'text': "And there is the table we're going to assign it to.", 'start': 2996.734, 'duration': 2.442}, {'end': 3001.397, 'text': 'And there is our meta table.', 'start': 2999.516, 'duration': 1.881}, {'end': 3003.779, 'text': 'So set meta table right like that.', 'start': 3001.677, 'duration': 2.102}, {'end': 3006.1, 'text': 'And then we can come in and check if they were equal.', 'start': 3004.039, 'duration': 2.061}, {'end': 3007.181, 'text': 'So a table.', 'start': 3006.16, 'duration': 1.021}, {'end': 3009.484, 'text': 'is equal to a table.', 'start': 3007.603, 'duration': 1.881}, {'end': 3013.907, 'text': "that's going to work, of course, and it had a little bit of a bug up here in the a table.", 'start': 3009.484, 'duration': 4.423}], 'summary': 'Setting up meta table and attaching meta methods to a table for comparison.', 'duration': 29.68, 'max_score': 2984.227, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2984227.jpg'}, {'end': 3087.271, 'src': 'embed', 'start': 3060.147, 'weight': 0, 'content': [{'end': 3065.993, 'text': "Now let's take a look at object-oriented programming, or at least Lua's version of object-oriented programming.", 'start': 3060.147, 'duration': 5.846}, {'end': 3073.462, 'text': "Okay. so, just to make this very clear, Lua is not an OOP language and it doesn't allow you to define classes,", 'start': 3066.234, 'duration': 7.228}, {'end': 3077.146, 'text': 'but you can in some ways fake it using tables and metatables.', 'start': 3073.462, 'duration': 3.684}, {'end': 3082.329, 'text': "So what we're going to do here is we're going to create an animal table right like this.", 'start': 3077.446, 'duration': 4.883}, {'end': 3087.271, 'text': "And I'm going to define all the default values for everything inside of it.", 'start': 3082.949, 'duration': 4.322}], 'summary': "Lua's approach to object-oriented programming involves using tables and metatables to simulate classes.", 'duration': 27.124, 'max_score': 3060.147, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs3060147.jpg'}, {'end': 3129.175, 'src': 'embed', 'start': 3103.203, 'weight': 3, 'content': [{'end': 3109.886, 'text': 'Okay, so there is the table we have created for animal, or the object that we are trying to create inside of here.', 'start': 3103.203, 'duration': 6.683}, {'end': 3115.669, 'text': "Now we have to define a function for our table that's going to allow us to initialize this guy.", 'start': 3110.066, 'duration': 5.603}, {'end': 3120.571, 'text': "And how we do that is with function animal, and I'm going to give it the name of new.", 'start': 3115.809, 'duration': 4.762}, {'end': 3129.175, 'text': 'And it is going to receive a height, a weight, a name, and a sound, very similar to an object-oriented programming language.', 'start': 3120.911, 'duration': 8.264}], 'summary': 'Creating a table for animals and defining a function to initialize with height, weight, name, and sound.', 'duration': 25.972, 'max_score': 3103.203, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs3103203.jpg'}, {'end': 3339.586, 'src': 'embed', 'start': 3309.662, 'weight': 4, 'content': [{'end': 3312.705, 'text': "So let's say we want to create a brand new object called cat.", 'start': 3309.662, 'duration': 3.043}, {'end': 3320.17, 'text': 'We can inherit all of the functions defined inside of our animal object just by calling new right like this.', 'start': 3312.945, 'duration': 7.225}, {'end': 3321.011, 'text': 'There we go.', 'start': 3320.491, 'duration': 0.52}, {'end': 3322.512, 'text': 'Now we have all that.', 'start': 3321.071, 'duration': 1.441}, {'end': 3323.733, 'text': 'We have the two string.', 'start': 3322.552, 'duration': 1.181}, {'end': 3328.097, 'text': 'We have the height, weight, name, and sound, all that stuff inside of our new cat object.', 'start': 3323.773, 'duration': 4.324}, {'end': 3332.38, 'text': 'We can, of course, come in here and overwrite any of the functions.', 'start': 3328.337, 'duration': 4.043}, {'end': 3339.586, 'text': "So one of the functions we want to overwrite, let's say we want to overwrite new and how it works inside of our new cat objects.", 'start': 3332.48, 'duration': 7.106}], 'summary': 'Using inheritance, a new cat object is created with inherited functions, allowing overwriting of specific functions.', 'duration': 29.924, 'max_score': 3309.662, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs3309662.jpg'}, {'end': 3404.348, 'src': 'embed', 'start': 3374.146, 'weight': 5, 'content': [{'end': 3377.61, 'text': 'Remember we just changed this cat new instead of animal new.', 'start': 3374.146, 'duration': 3.464}, {'end': 3378.671, 'text': 'Throw that right there.', 'start': 3377.83, 'duration': 0.841}, {'end': 3381.614, 'text': "And we're going to do the same sort of thing for toString.", 'start': 3379.111, 'duration': 2.503}, {'end': 3382.415, 'text': "We're going to say cat.", 'start': 3381.774, 'duration': 0.641}, {'end': 3386.164, 'text': "to string and how this guy's going to change is.", 'start': 3383.083, 'duration': 3.081}, {'end': 3393.125, 'text': "we're going to say something like says whatever and loves, and let's get his favorite food inside of here.", 'start': 3386.164, 'duration': 6.961}, {'end': 3394.346, 'text': 'so there that is.', 'start': 3393.125, 'duration': 1.221}, {'end': 3396.906, 'text': "we'll just go self favorite food.", 'start': 3394.346, 'duration': 2.56}, {'end': 3399.767, 'text': "and now let's come down and create a cat.", 'start': 3396.906, 'duration': 2.861}, {'end': 3404.348, 'text': "so let's call it fluffy and we'll just call it with cat new, just like we did before.", 'start': 3399.767, 'duration': 4.581}], 'summary': 'Modifying a class to create a new cat object with specific attributes.', 'duration': 30.202, 'max_score': 3374.146, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs3374146.jpg'}], 'start': 2726.772, 'title': "Lua's metatables and oop", 'summary': 'Covers defining and using metatables and metamethods in lua, including operations for tables, and implementing object-oriented programming using tables and metatables for creating and inheriting objects.', 'chapters': [{'end': 3059.887, 'start': 2726.772, 'title': 'Metatables and metamethods', 'summary': 'Discusses how to define and use metatables and metamethods in lua, including defining operations such as addition, subtraction, multiplication, division, concatenation, and comparison for tables, and attaching them to the table using setmetatable.', 'duration': 333.115, 'highlights': ['The chapter discusses how to define and use metatables and metamethods in Lua It explains the concept of metatables and metamethods and how they are utilized in Lua programming.', 'Defining operations such as addition, subtraction, multiplication, division, concatenation, and comparison for tables It provides a detailed explanation of how to define these operations for tables using metamethods in Lua.', 'Attaching metamethods to the table using setmetatable It demonstrates the process of attaching metamethods to a table using the setmetatable function in Lua.']}, {'end': 3443.537, 'start': 3060.147, 'title': "Lua's object-oriented programming", 'summary': "Discusses lua's version of object-oriented programming using tables and metatables to simulate classes, demonstrating the creation and initialization of an animal object, and inheritance with a new cat object.", 'duration': 383.39, 'highlights': ["Demonstrating the creation and initialization of an animal object using tables and metatables. The speaker explains how to define an animal table with default values for height, weight, name, and sound, as well as initializing it with a function, showcasing Lua's approach to object creation.", "Illustrating inheritance with a new cat object and the ability to overwrite functions. The speaker demonstrates how a new cat object can inherit all functions from the animal object and showcases the ability to overwrite functions such as 'new' and 'toString' to add new attributes and behaviors.", "Detailing the creation of a cat object and showcasing the overridden toString function. The process of creating a cat object, setting its attributes, and showcasing the overridden 'toString' function to display specific information about the cat object, including its favorite food, is explained."]}], 'duration': 716.765, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/iMacxZQMPXs/pics/iMacxZQMPXs2726772.jpg', 'highlights': ['Covers defining and using metatables and metamethods in Lua.', 'Defining operations such as addition, subtraction, multiplication, division, concatenation, and comparison for tables.', 'Attaching metamethods to the table using setmetatable.', 'Demonstrating the creation and initialization of an animal object using tables and metatables.', 'Illustrating inheritance with a new cat object and the ability to overwrite functions.', 'Detailing the creation of a cat object and showcasing the overridden toString function.']}], 'highlights': ['The chapter provides insights into string manipulation and function usage, showcasing multiple ways to use functions inside of Lua.', 'The chapter explains how to create and call functions in Lua, including returning multiple values.', 'The chapter illustrates a Lua function that can handle an unknown number of parameters, processing them to calculate the total sum and returning the result, showcasing the flexibility of the function to handle diverse inputs.', 'The chapter explains the concept of closures in Lua, demonstrating how an inner function can remember and access changes made to the variables in the outer function, highlighting the practicality and behavior of closures in storing changing values.', 'The chapter provides an overview of coroutines, likening them to threads in other programming languages, explaining their statuses of running, suspended, dead, or normal, and showcases the implementation of multiple coroutines to run tasks concurrently, emphasizing their ability to execute tasks in a cooperative manner.', 'Covers defining and using metatables and metamethods in Lua.', 'Defining operations such as addition, subtraction, multiplication, division, concatenation, and comparison for tables.', 'Attaching metamethods to the table using setmetatable.', 'Demonstrating the creation and initialization of an animal object using tables and metatables.', 'Illustrating inheritance with a new cat object and the ability to overwrite functions.', 'Detailing the creation of a cat object and showcasing the overridden toString function.', 'The chapter covers creating, overwriting, and appending files using FileIO in Lua.', "Demonstrates the process of creating a custom module in Lua named 'convert' to convert feet to centimeters, returning the result of 12 feet being converted to 42.480 centimeters.", "Explains the usage of 'require' to access the custom module created, enabling the function 'feet to centimeters' to be utilized for conversion, resulting in 42.480 centimeters when 12 feet is input.", 'The importance of proper error handling is emphasized to prevent mistakes in file operations.', 'The chapter covers working with conditional statements like if, else, else if, and comparison to the ternary operator.', 'It highlights the absence of a switch statement in Lua and the ability to achieve similar functionality using if and else statements.', 'The tutorial covers string operations such as getting the length of a string, replacing specific strings, finding indexes of words, and converting strings to uppercase and lowercase.', 'The tutorial explains looping concepts using a while loop and demonstrates the usage of the break statement to exit the loop.', 'The tutorial introduces the repeat-until loop and demonstrates how to continuously get user input until a specific condition is met.', "The chapter explains for loops and demonstrates cycling through a table using the 'pairs' function to access and print values.", 'The chapter covers tables and multi-dimensional arrays, including populating and accessing values using nested for loops and indexing.', 'Demonstrates formatting float values with precision of 10 decimal places and importing math library to get the value of pi.', 'Explains relational and logical operators, including greater than, less than, equal to, not equal to, and, or, not.', 'Illustrates the usage of conditional statements with if, else if, and else, demonstrating their syntax and functionality.', "The chapter emphasizes the importance of using 'end' with if statements and explains the limitation of accessing a local variable outside of the if statement.", "The chapter demonstrates the usage of logical operators 'or', 'and', and 'not' in Lua, showcasing examples of their functionality and output.", 'The chapter explains the absence of a ternary operator in Lua and provides an alternative approach using logical operators to achieve similar functionality.']}