|
Re: Can anyone create new commands?
What do you mean by 'commands?' Are you referring to functions? Or are you referring to the autonomous program provided by FIRST? If you're talking about built-in functions, then you certainly can! The basic format of a function is this:
(replace the items in square brackets with the proper keywords)
Code:
[returntype] [functionname]([argtype1] [argname1],[argtype2] [argname2]...){
/*Your code here*/
return [result];
}
For example:
Code:
double squareit(double numberToBeSquared){
return numberToBeSquared*numberToBeSquared;
}
__________________
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!
|