Skip to content

Commit

Permalink
Now with fewer assignment instead of equality-test bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ab3nd committed Feb 16, 2011
1 parent 5c3cfca commit 69cdc8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,24 @@ int main(int argc, char* argv[])
{
MissileLauncher mc;
if(mc.init() == 0){
//Turn for a time mode
mc.turn(LEFT, 1.5);
mc.turn(UP, 1);
mc.fire();
//mc.fire();
mc.turn(RIGHT, 1.5);
mc.turn(DOWN, 1);
//
//Turn until I say mode
mc.turn(UP, 0.0);
sleep(1);
mc.stop();
//mc.fire();
mc.turn(DOWN, 0);
sleep(1);
mc.stop();
}else{
cerr << "Failed to initialize missile launcher" << endl;
//Don't call deinit unless init worked
return 1;
}
mc.deinit();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion missile_launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void MissileLauncher::turn(MissileCmd direction, double delay)
}
else
{
if (delay = 0)
if (delay == 0)
{
/* Start moving. This means it keeps moving until you tell it to stop.
* Good for feedback loops, bad for not hitting the stops and abusing
Expand Down

0 comments on commit 69cdc8e

Please sign in to comment.