Generalis Scriptis
Posted: 27 Oct 2006, 14:49
After de-scriptorizing the script of the ArmCom from XTA, i got this:
Is that variable, bMoving, needed? I mean, suposedly the function "walk()" is only called if it is moving.
Or are they to make the script stop running the function "walk()" as soon as one of those cycles
Is finished and, if it was not like this, it would try to execute the whole script and all those "if( bMoving )"s» even after it actually stoped moving?
The MynnCom doesn't uses that, it uses:
Wouldn't it be the same (and best) to just be:
Code: Select all
walk()
{
if( bMoving )
{
move ...;
...
turn ...;
sleep 40;
}
if( bMoving )
{
turn ...;
...
turn ...;
sleep 40;
}
...
}
StartMoving()
{
bMoving = TRUE;
}
StopMoving()
{
bMoving = FALSE;
}
Or are they to make the script stop running the function "walk()" as soon as one of those cycles
Code: Select all
if( bMoving )
{
move ...;
...
turn ...;
sleep 40;
}
The MynnCom doesn't uses that, it uses:
Code: Select all
Walk()
{
if( TRUE )
{
move ...;
...
turn ...;
sleep 50;
if( TRUE )
{
move ...;
...
turn ...;
return (0);
}
}
}
Code: Select all
Walk()
{
move ...;
...
turn ...;
sleep 50;
if( TRUE )
move ...;
...
turn ...;
return (0);
}