To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1756
1755  |  1757
Subject: 
Re: video game type thing...
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 12 Mar 2001 19:34:08 GMT
Viewed: 
1249 times
  
On Mon, 12 Mar 2001, Nick Howell wrote:

if(enemy = 1)
{
fight;
monitor;
}

I think you mean if (enemy == 1).

Also, the identifier "fight" resolves to the address of the fight
function. Doing "fight;" is equivalent to doing "1;". It's legal, but it
doesn't accomplish anything. You want to do "fight();" and "monitor();".

You'll probably have trouble with the compiler not knowing what you're
talking about at this point. You need to either provide prototypes for
your function (put "void fight(void);" and the like at the beginning of
your file), or have the actual function itself in the file before you call
it.

--
"From now on, we live in a world where man has walked on the moon.
And it's not a miracle, we just decided to go." -- Jim Lovell

Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>



Message has 2 Replies:
  Re: video game type thing...
 
Thanks for the response! Now I'm almost ready to test it. I just need to know if, when you have a call void function, and you then use the int main() to close the program with return 0;, will the void keep running? Thanks Nick Howell (...) (24 years ago, 12-Mar-01, to lugnet.robotics.rcx.legos)
  Re: video game type thing...
 
Thanks for the response! Now I'm almost ready to test it. I just need to know if, when you have a call void function, and you then use the int main() to close the program with return 0;, will the void keep running? Here's my current copy, without (...) (24 years ago, 12-Mar-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  video game type thing...
 
I'm building a video game type thing. It has three touch sensors, for left, right, and fire. The LCD controls where the enemy is. I'm having some problems with my code, so here it is(I'm using kernel 0.2.4): #include "conio.h" #include "dmotor.h" (...) (24 years ago, 12-Mar-01, to lugnet.robotics.rcx.legos)

13 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR