1 00:00:00,710 --> 00:00:02,820 Ella and welcome him legislature. 2 00:00:03,000 --> 00:00:11,980 I'm going to explain how the on two loop works in the Ruby programming language. 3 00:00:12,810 --> 00:00:17,130 What does he want to loop do. 4 00:00:17,130 --> 00:00:27,220 Basically the on two loop will execute while a condition is false. 5 00:00:27,360 --> 00:00:37,430 So on two loops condition is physically separated from the cood using did do key worked. 6 00:00:37,430 --> 00:00:48,400 And this is what the basic syntax looks like if go on till key word condition and then the code that 7 00:00:48,420 --> 00:00:50,360 will execute. 8 00:00:50,560 --> 00:00:53,140 And then the end of the statement. 9 00:00:53,170 --> 00:01:00,110 So I've got my interactive Ruby some when to illustrate how they still works. 10 00:01:00,210 --> 00:01:02,990 I'm going to create a variable x. 11 00:01:03,240 --> 00:01:09,470 I'm ready to send out one are create a variable y. 12 00:01:10,590 --> 00:01:13,830 And I said that to lemon. 13 00:01:15,700 --> 00:01:27,130 Then I'll implement B until on t and then the condition on 2 x. 14 00:01:29,590 --> 00:01:34,250 N y n do that. 15 00:01:35,080 --> 00:01:44,450 And then I'll specify the code that will be executed at one time in print. 16 00:01:46,290 --> 00:01:49,980 X comma. 17 00:01:50,900 --> 00:01:52,030 Then the quote 18 00:01:54,630 --> 00:02:04,150 say I need some juice. 19 00:02:06,550 --> 00:02:08,010 Who's that. 20 00:02:08,670 --> 00:02:10,140 Unknown how. 21 00:02:10,500 --> 00:02:18,570 Escaped with a backslash so that he can print out in separate lines. 22 00:02:19,080 --> 00:02:25,710 And this is where I iterate the loop so you'll do X. 23 00:02:27,740 --> 00:02:30,250 Lots equals to 1. 24 00:02:30,320 --> 00:02:37,990 What that means is that each time it goes to in a loop each will increase it by 1. 25 00:02:38,950 --> 00:02:39,280 No. 26 00:02:39,320 --> 00:02:41,720 End quote. 27 00:02:41,770 --> 00:02:46,550 You can see no executed if code is displayed. 28 00:02:47,060 --> 00:02:54,120 Me executed the code that I have specified based on the condition. 29 00:02:54,860 --> 00:02:58,790 So that's how it may still works. 30 00:02:58,790 --> 00:02:59,930 Thanks for watching. 31 00:02:59,930 --> 00:03:00,990 Bye for now.