Created
September 22, 2019 09:45
-
-
Save vovs03/f5a33bfffed4969eb5d70a8fd3eaec8d to your computer and use it in GitHub Desktop.
Traffic-light-plus-arrow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = ['Green', 'Yellow', 'Red'] | |
b = ['Red', 'Green'] | |
c = ['Green', 'Yellow', 'Red', 'Rigth-arrow'] | |
variant =[a, b, c] | |
txt = "Use variant " | |
def switch_color(variant) | |
10.times do | |
puts variant.sample | |
# sleep 5 | |
end | |
end | |
puts "#{txt} #{a}" | |
switch_color(a) | |
puts "---" | |
puts "#{txt} #{b}" | |
switch_color(b) | |
puts "---" | |
puts "#{txt} #{c}" | |
switch_color(c) | |
puts "---" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Проверка задачи тут: