Tuesday, November 17, 2009

Programming a Switch

I've been working with RobotC for a bit now and I've come to realize something about the way switches can be programmed in Logo. Logo allows you to write this implied boolean equation with if switcha [a, on] or if not swticha [a, off], while boolean equations are true or false or 0 or 1 in other programming languages. So I tried programming a switch with if switcha = 1 [a, on] and it worked just as well. I much prefer that approach because of its similarity to most other programming languages.

No comments: