Thanks for clarifying/mentioning the difference between for/while loops and using "repeat" -- very useful series!
@Stevesteacher Жыл бұрын
I am happy to help :)
@GPEART1 Жыл бұрын
I came here from another tutorial that poorly explained Lua while loops, your examples were really helpful, thanks!
@tooeooeenee48553 жыл бұрын
Perfect Python tutorial video as always 😋
@Stevesteacher3 жыл бұрын
Thanks! 😃
@tooeooeenee48553 жыл бұрын
@@StevesteacherNp :)
@abelsony20063 ай бұрын
even if its not a python tutorial, lua and python are kind of similar😅
@liarleyev848711 ай бұрын
this playlist has been very helpful, it's perfect for those who come from other programming languages and just want an overview!
@crabcakeenthusiast692 Жыл бұрын
thank you so much for this series I'm learning lua to make roblox games!
@Ayush-dh2qj3 ай бұрын
In Lua, the repeat ... until loop is similar to a do ... while loop in other programming languages. It executes the block of code inside the loop at least once and continues to execute it until the condition specified by the until clause becomes true. Let's break down the two cases: Case 1: lua Copy code repeat print('hello') until false Explanation: The loop will keep executing until the condition after until becomes true. Since the condition here is false, which will never be true, the loop will continue indefinitely. Result: It prints "hello" repeatedly in an infinite loop. Case 2: lua Copy code repeat print('hello') until true Explanation: The loop will execute at least once because that's how the repeat ... until loop works. After printing "hello" once, it checks the condition after until, which is true. Since true is already satisfied, the loop stops. Result: It prints "hello" only once and exits the loop. In summary: until false causes an infinite loop. until true causes the loop to run only once, because the condition is already met after the first iteration.
@realscripter1 Жыл бұрын
can you delay the loop as in "wait(0.1)"?
@Stevesteacher Жыл бұрын
Something like this might work: stackoverflow.com/a/17987723
@bingbong716910 ай бұрын
as I am writing this I have not thought of exactly implementing it but you can think of how to do so with your loop, but one way I know how to wait in Lua is os.execute("sleep 1") this sleeps the program entirely for 1 sec.... but the link @Stevesteacher put is definitely worth looking at too!
@maometos11 ай бұрын
This language reminds me of the old school languages like Pascal and QuickBASIC