Otherwise, you can generate bugs in your code by using a similar sounding name or value on your variable. Subroutines and Functions Writing a single long line of code can be tedious, and can also increase your chances of coding in a bug. It is often best to create subroutines for handling blocks of code. If you code things up properly, you can also reuse code quite easily. The bulk of your software is going to exist in subroutines and functions.
Most subroutines are very short, and consist of a well modularized bit of code.
It will ' put the robot into a known state. Input switches are active low. Behave is the routine that determines the robots behaviour. If the TurnDelayCount is Zero, then we can ' go forward. Otherwise, we will continue to ' turn in the TurnDelayCount direction.