Loops - Lua Tutorial (Part 7)

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

Steve's teacher

Steve's teacher

Күн бұрын

Пікірлер: 16
@niteowl9491
@niteowl9491 2 жыл бұрын
Thanks for clarifying/mentioning the difference between for/while loops and using "repeat" -- very useful series!
@Stevesteacher
@Stevesteacher 2 жыл бұрын
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 Жыл бұрын
this playlist has been very helpful, it's perfect for those who come from other programming languages and just want an overview!
@Ayush-dh2qj
@Ayush-dh2qj 4 ай бұрын
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.
@crabcakeenthusiast692
@crabcakeenthusiast692 Жыл бұрын
thank you so much for this series I'm learning lua to make roblox games!
@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 11 ай бұрын
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!
@davejackson88
@davejackson88 Жыл бұрын
thanks guy
@maometos
@maometos Жыл бұрын
This language reminds me of the old school languages like Pascal and QuickBASIC
@Silver_spoon_602
@Silver_spoon_602 13 күн бұрын
print( " . . " ) print(" w")
User Input - Lua Tutorial (Part 8)
7:00
Steve's teacher
Рет қаралды 6 М.
Functions in Lua - Lua Tutorial (Part 10)
28:48
Steve's teacher
Рет қаралды 6 М.
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
Jonathan Blow on Refactoring
7:10
Anton Swifton
Рет қаралды 143 М.
2 Years Of Learning C | Prime Reacts
22:24
ThePrimeTime
Рет қаралды 335 М.
Making a Game in Lua with No Experience
5:52
Goodgis
Рет қаралды 395 М.
Tables (Arrays) - Lua Tutorial (Part 9)
15:59
Steve's teacher
Рет қаралды 14 М.
Roblox Loops Explained As If You Were 5
12:38
ByteBlox
Рет қаралды 17 М.
Co-Routines - Lua Tutorial (Part 11)
11:01
Steve's teacher
Рет қаралды 8 М.
Lua in 100 Seconds
2:24
Fireship
Рет қаралды 2,3 МЛН
but what is 'a lifetime?
12:20
leddoo
Рет қаралды 90 М.
NeovimConf 2022: Lua, a Primer
30:10
John McBride
Рет қаралды 21 М.
Самые простые строительные леса
0:54
Канал ИДЕЙ
Рет қаралды 1 МЛН
Черная Magic Mouse
0:53
Romancev768
Рет қаралды 807 М.
пранк: псих сбежал из дурдома
0:53
Анна Зинкина
Рет қаралды 1,7 МЛН
Robot 🤖 cleaning 🧹
0:57
Bunnal 𝚃𝚎𝚌𝚑
Рет қаралды 4,7 МЛН