|
Re: Modular Autonomous?
I agree with the posters above: modular code is what makes object-oriented code as powerful and elegant as it is. My philosophy is that if you're copy and pasting code everywhere, you haven't created enough methods/function/subroutines/whatever-they're-called. Our autonomous code looks like:
DriveSequence();
drive(-0.25,0);
Timer.delay(0.2);
drive(0,0);
turn(a,b);
fire();
If I had more time, I would've put this in a method of its own:
drive(-0.25,0);
Timer.delay(0.2);
drive(0,0);
|