Solution: Generate Lotto Numbers
Go over the implementation of the lotto number generator.
We'll cover the following...
We'll cover the following...
Solution
Ruby 3.1.2
count = 0array = []until count == 6lotto_number = rand(49)lotto_number += 1if array.include?(lotto_number)# Number already exist"nextendarray << lotto_numbercount += 1endputs "Your winning lotto numbers are #{array}, good luck!"
Explanation
Line 3: We use the
untilloop instead of awhileloop. This is equivalent ...