Loops - Lua Tutorial (Part 7)

  Рет қаралды 5,539

Steve's teacher

Steve's teacher

Күн бұрын

Пікірлер: 15
@niteowl9491
@niteowl9491 2 жыл бұрын
Thanks for clarifying/mentioning the difference between for/while loops and using "repeat" -- very useful series!
@Stevesteacher
@Stevesteacher Жыл бұрын
I am happy to help :)
@GPEART1
@GPEART1 Жыл бұрын
I came here from another tutorial that poorly explained Lua while loops, your examples were really helpful, thanks!
@tooeooeenee4855
@tooeooeenee4855 3 жыл бұрын
Perfect Python tutorial video as always 😋
@Stevesteacher
@Stevesteacher 3 жыл бұрын
Thanks! 😃
@tooeooeenee4855
@tooeooeenee4855 3 жыл бұрын
@@StevesteacherNp :)
@abelsony2006
@abelsony2006 3 ай бұрын
even if its not a python tutorial, lua and python are kind of similar😅
@liarleyev8487
@liarleyev8487 11 ай бұрын
this playlist has been very helpful, it's perfect for those who come from other programming languages and just want an overview!
@crabcakeenthusiast692
@crabcakeenthusiast692 Жыл бұрын
thank you so much for this series I'm learning lua to make roblox games!
@Ayush-dh2qj
@Ayush-dh2qj 3 ай бұрын
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
@realscripter1 Жыл бұрын
can you delay the loop as in "wait(0.1)"?
@Stevesteacher
@Stevesteacher Жыл бұрын
Something like this might work: stackoverflow.com/a/17987723
@bingbong7169
@bingbong7169 10 ай бұрын
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!
@maometos
@maometos 11 ай бұрын
This language reminds me of the old school languages like Pascal and QuickBASIC
@davejackson88
@davejackson88 Жыл бұрын
thanks guy
User Input - Lua Tutorial (Part 8)
7:00
Steve's teacher
Рет қаралды 6 М.
If statements - Lua Tutorial (Part 6)
15:49
Steve's teacher
Рет қаралды 7 М.
Andro, ELMAN, TONI, MONA - Зари (Official Music Video)
2:50
RAAVA MUSIC
Рет қаралды 2 МЛН
Working with Files - Lua Tutorial (Part 12)
12:32
Steve's teacher
Рет қаралды 6 М.
Lua in 100 Seconds
2:24
Fireship
Рет қаралды 2,3 МЛН
Lua Tutorial
57:25
Derek Banas
Рет қаралды 970 М.
Tables (Arrays) - Lua Tutorial (Part 9)
15:59
Steve's teacher
Рет қаралды 14 М.
Co-Routines - Lua Tutorial (Part 11)
11:01
Steve's teacher
Рет қаралды 8 М.
Strings in Lua - Lua Tutorial (Part 5)
18:28
Steve's teacher
Рет қаралды 10 М.
How To Use Functions In Python (Python Tutorial #3)
14:55
CS Dojo
Рет қаралды 2,4 МЛН
[LUA] Ep. 6 - Loops
10:58
〈CODE BLUE〉
Рет қаралды 45 М.