I have been trying to complete a program for the Line Counter challenge for my class but my program seems to have many errors in it. I have tried many times to correct them but it doesn't seem to work. D: What am I doing wrong? Here is my code:

But if you notice you have two "void forwardlines(int numLines)", with different code inside of them. So either delete the one, or change the name of one so they are not the same. But then you also have a global variable called "int numLines", there is also an argument (that value you pass to a function) called that, so I don't know which it will take the value from when you read it. The global variable is not being used so it could be deleted, unless their is something else I am missing.

Another thing is that "thresholdValue" is never set to a value.

That should get the code to compile, but I don't know about the code itself.Hope this helps.

_________________What is easy you have done, what is hard you can do, what is impossible will take a little longer

Fri Nov 08, 2013 12:14 pm

yoloballer#

Rookie

Joined: Thu Nov 07, 2013 7:22 pmPosts: 4

Re: Help With Robo Line Counter Challenge?

Wow! Thank you for helping me out, however I am still having issue with two parts of the program. On the first part of the program it says that the "int numLines is unreferenced. What does the program mean by that? Also how do you suppose I fix the two task main problem or how to combine them, I really appreciated your help.

Thanks!

Fri Nov 08, 2013 2:53 pm

tr24em

Rookie

Joined: Thu May 02, 2013 10:52 amPosts: 22

Re: Help With Robo Line Counter Challenge?

**info***: Unreferenced variable 'NumLines'Is saying that that variable is unused, so it can be deleted.

As I showed in the last bit of code in my last post, the only thing that should be in task main is the program that the robot runs, the functions definitions (void function(int value) { code } ) should not be in there.

Or another way (I prefer to do it this way over the last for small-medium size programs, but I don't know if one way is absolutely better than the other, this way just makes it easier to quickly find task main):

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum