
Re: Code not working help plz
The issue is at the start of your parent while loop. Each time the elevator moves up, the program flows seamlessly from one inner loop to the next. Whenever the elevator descends, however, the main loop is rerun, resetting floorCount to 1. This is only an issue if you're moving down to a floor other than floor 1, which only occurs when you move from F3 to F2. The solution is easy: just move the problem code outside of the loop.