Programming instructions
Reference
Project Lead The Way
©
and Carnegie Mellon Robotics Academy
©
/ For use with VEX
®
Robotics Systems
If Statements •
Embedded if/if-else Statements
with Natural Language
if(condition)
{
if(condition)
{
// true-commands
}
else
{
// false-commands
}
}
Pseudocode of an embedded if Statment:
Sometimes, especially with more complex tasks, your robot will have to make multiple consecutive
decisions before performing a behavior. This can be accomplished by embedding, or placing, if
Statments within other if Statements.
(condition)
Either true or false
(true) commands
Commands placed here will run
if the (condition) is true.
(false) commands
Commands placed here will run
if the (condition) is false.
Go to Reference Links