Skip to main content

Flight Traffic Controller Challenge Solution - Python

Because loops have not yet been introduced, the following is a perfectly acceptable solution:
Sample VEXcode V5 Python solution reads arm motor dot set position 0 degrees; arm motor spin for forward 90degrees; arm motor spin reverse 90 degrees then wait 3 seconds. Next are 4 spin for blocks to spin the arm motor forward 45 degrees, reverse 45 degrees, forward 45 degrees, reverse 45 degrees, and a wait 5 seconds commands. The last 6 spin for commands alternately spin the arm motor forward and reverse 90 degrees.

More advanced students might use loops to simplify the solution.

A VEXcode V5 Python sample solution reads arm motor set position 0 degrees; then arm motor spin for forward 90 degrees; arm motor spin for reverse 90 degrees, followed by a wait 3 seconds command. Next is a for loop set to 2 with two arm motor spin for commands - forward 45 degrees and reverse 45 degrees. Then a wait 5 seconds followed by a for loop set to 3 with 2 spin for commands to spin the arm motor forward 90 degrees and reverse 90 degrees.