Ruby Programming Tutorial - Lesson 10 - Loops in Ruby :: Until Loop

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@bilal-haider·
0.000 HBD
Ruby Programming Tutorial - Lesson 10 - Loops in Ruby :: Until Loop
![ruby.jpg](https://steemitimages.com/DQmbqUmmotADnnYEZ1ppL2sr6txmFUQ3MCRcXTZ1Ch5FjP7/ruby.jpg)

This article .. 
We are going to learn about Until loop. 

###### Sell burgers, each burger you sell you earn 1$ ... reach your 100$ target 
###### once you reach your target display a message .. of target achievement 

```
# Total Burgers need to sell ? 

$burgers_to_be = $richness_target / $burger_price

begin 
    puts "I need to sell more Burgers :) .. "
    $burgers_balance += $burger_price
    $current_sale = $burgers_balance / $burger_price
    puts "Burger #$current_sale is Sold !! "
    puts "Earned #$burger_price$ "

end until $burgers_balance >= $richness_target


puts "WOW I Sold #$burgers_to_be Burgers "

```

Here is graphic example.. 
![](https://steemitimages.com/DQmNkZfWvcCgns3G569MX61gTz8Z8Gxq1BHMYqoA88EKbMQ/image.png)



Here is another example of until loop.. 
This loop becomes an endless loop.. so you need to hit CTRL + C
to break the loop

```

# Tell a girl, she cannot be my life partner until she has these three properties 

not_rubyprogrammer          = true
not_rich                    = true
not_beautifull              = true



until !(not_rubyprogrammer && not_rich && not_beautifull)
    puts "No You cannot become my life partner .."
end 

```

![Capture.JPG](https://steemitimages.com/DQmek5KggdRrqArTxQdGZEQZL3dVnWTbgo2NH9xjasVkSsb/Capture.JPG)

Pray for me that i get a good, lady in my life :D thanks
👍 , , , , , , , , , , , , , , , , , , , , , , ,