Skip to content

alee733/1-traffic-light

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Prep exercise - traffic light

Let's have a deeper look at the working of traffic lights this week so that we can practice logic and loops. In traffic-light-1.js and traffic-light-2.js you will find the same requirements but with different ways of representing the traffic light. Have a look through the files and solve them so you can see how the way we represent data affects the way we need to solve problems.

Things to think about

  • Which way of representing the traffic light did you find better? Why?
  • What happens if you change the loop to a do-while loop instead of a while loop? Why?
  • We could have also used a for loop to make the traffic light do 2 full rotations. Do you think that would be better? Why or why not?

About

HYF, Week 2, prep-exercise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%