Skip to content

Instantly share code, notes, and snippets.

@vovs03
Created September 22, 2019 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vovs03/f5a33bfffed4969eb5d70a8fd3eaec8d to your computer and use it in GitHub Desktop.
Save vovs03/f5a33bfffed4969eb5d70a8fd3eaec8d to your computer and use it in GitHub Desktop.
Traffic-light-plus-arrow
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 "---"
@vovs03
Copy link
Author

vovs03 commented Sep 22, 2019

Проверка задачи тут:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment