Learning Lua: Different types of Loops in scripting and when to use them

preview_player
Показать описание
Unlock the power of Lua programming with my latest book, "Learning Lua." Whether you're a beginner or an experienced coder, this comprehensive guide will take you on a journey to mastering Lua. Get your copy now:

In Part 10, we learn about using for, while, and repeat loops.

Рекомендации по теме
Комментарии
Автор

Ok so i'm getting it. so the at 0:56 the 1, is the start then 10 is the end. the start then use do to start the action of what ur doing lol then end. thank you sir. 😅

Voltsii-
Автор

Thanks so much, these tutorials are helping so much, i know i'm very late but i wanted to know. at 5:00 where you moved the i = i + 1 so that it stops at 10. will it work if you change the "if i ==10" to "if i > 10"?

anrichvanzyl
Автор

Hello Brian its me again! I'm still learning Lua and thanks to you Lua has been fun and easy to learn! I'm currently having a problem right now, I copied your code at 6:58 so I can use it as refrencing and as an example to make my own version of that code except I changed 'I' to 'Y' and when I execute the code it just goes on and on forverver but I can still see 'repeat loop: 1'

example:
repeat loop: 1261888
repeat loop: 1261888
repeat loop: 1261888
repeat loop: 1261888
repeat loop: 1261888
repeat loop: 1261888
repeat loop: 1261888
repeat loop: 1261888
repeat loop: 1

Am I doing something wrong? Im still a newbie at this sorry.

josenunez
Автор

isnt repeat similar to do while in other languages

lordexplosionmurderbakugo
welcome to shbcf.ru