Article 5QSWH [SOLVED] How do I convert my traffic signal python script into a bash script?

[SOLVED] How do I convert my traffic signal python script into a bash script?

by
Varister
from LinuxQuestions.org on (#5QSWH)
I would like to convert the following code to bash:

Code:from random import randrange

Red = 1
Yellow = 2
Green = 3

def process_light(x):
if x == Red:
print("red light")
return Green

elif x == Yellow:
print("yellow light")
return Red

elif x == Green:
print("green light")
return Yellow

generatedLight = randrange(1, 4)
while True:
generatedLight = process_light(generatedLight)latest?d=yIl2AUoC8zA latest?i=zV1hC4T7fss:Ry3_iUCdojE:F7zBnMy latest?i=zV1hC4T7fss:Ry3_iUCdojE:V_sGLiP latest?d=qj6IDK7rITs latest?i=zV1hC4T7fss:Ry3_iUCdojE:gIN9vFwzV1hC4T7fss
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments