Go to Post I like my eyeballs where they are ::safety:: - ,4lex S. [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #18   Spotlight this post!  
Unread 27-04-2010, 18:36
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: List of Killer Bee Bot Bottoms

Quote:
Originally Posted by Schnabel View Post
I found an error in your code, let's debug:


In this setting, 33 is your variable (assuming you defined it earlier). Let's assume 33 is currently set to null. In your example above, you are saying "If set 33 to Team then call Win" However Team is not a valid variable, instead it should be 'Team'. So that would kill you first. THEN you are setting 33 to Team, I think you would rather do a Binary test now wouldn't you? You would rather it be "If 33 is Team then call Win" which would require double =. So for this statement to function properly, you should have wrote:
If (33 == 'Team') WIN();
.
.
.
.
.
.
.
.
.
.
.
.
.
.
I disagree. == is not =.
= sets one variable to another. == checks for a comparison. so I am checking that team is equal to 33, if it is, then win. The order does not matter.
Actually, in C (or C++), it is better to put the constant before the variable, in case you forget the second =, so the compiler will give you an error for setting a constant instead of getting some crazy error at runtime.

EDIT: I see that BJC forgot the second =. The actual one says "if (33==team) win();"
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Killer Bee Volunteer Recognition Award Jay TenBrink Thanks and/or Congrats 5 09-12-2006 22:41
National Spelling Bee on Prime Time Again, Why Not FIRST? skimoose Chit-Chat 4 31-05-2006 23:54
Killer Carts! Zzyzx General Forum 35 04-03-2006 15:38
Bumble Bee megacadet142 Math and Science 9 03-09-2004 15:44


All times are GMT -5. The time now is 19:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi