Subject:
|
Re: NQC programming guide
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 5 Dec 2006 23:39:17 GMT
|
Viewed:
|
3293 times
|
| |
![Post a public reply to this message](/news/icon-reply.gif) | |
In lugnet.robotics, linmix <linmix@gmail.com> wrote:
> Steve Lane <stevenrobertlane@ wrote:
> > I wouldn't say I was a great programmer either. An array is simply a sequence of
> > memory variables (say 1-10) that can be accessed via their numeric position.
>
> So why use an array with say 5 values and not 5 variables?
If you want to perform the same operation (or sum) on multiple variables, you
can use a loop. As long as you use the same variable that controls the loop to
control the array, then each successive iteration through the loop will perform
the sum on the next position in the array.
> > x++
> >
> > If you write x++ in your code and x=1, once used, one will be added to it so it
> > equals two.
> >
> > If you write ++x the one will be added before it's used. It's short hand for
> > x=x+1;
>
> so it's always +1, not like my pocket calculator which will keep adding
> the original value of x if I use a double +
> (5++ =10, 15, 20, etc.)
Yes, it's always plus one (or minus one X--;)
Steve
The other posters are right, learn basic C#.
|
|
Message is in Reply To:
![](/news/x.gif) | | Re: NQC programming guide
|
| (...) So why use an array with say 5 values and not 5 variables? (...) so it's always +1, not like my pocket calculator which will keep adding the original value of x if I use a double + (5++ =10, 15, 20, etc.) (...) (18 years ago, 5-Dec-06, to lugnet.robotics)
|
14 Messages in This Thread: ![NQC programming guide -lego-robotics@crynwr.com (linmix) (5-Dec-06 to lugnet.robotics)](/news/x.gif) ![](/news/246.gif) ![Re: NQC programming guide -Steve Lane (5-Dec-06 to lugnet.robotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC programming guide -lego-robotics@crynwr.com (linmix) (5-Dec-06 to lugnet.robotics)](/news/x.gif) ![](/news/246.gif) ![You are here](/news/here.gif)
![](/news/x.gif) ![](/news/28.gif) ![](/news/x.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: NQC programming guide -lego-robotics@crynwr.com (Lucio De Re) (6-Dec-06 to lugnet.robotics)](/news/x.gif)
![](/news/x.gif) ![](/news/268.gif) ![Re: NQC programming guide -Jordan Bradford (5-Dec-06 to lugnet.robotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC programming guide -lego-robotics@crynwr.com (linmix) (6-Dec-06 to lugnet.robotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC programming guide -lego-robotics@crynwr.com (steve) (7-Nov-06 to lugnet.robotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC programming guide -Chris Phillips (7-Dec-06 to lugnet.robotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC programming guide -lego-robotics@crynwr.com (linmix) (7-Dec-06 to lugnet.robotics)](/news/x.gif) ![](/news/46.gif) ![Re: NQC programming guide -Chris Phillips (7-Dec-06 to lugnet.robotics)](/news/x.gif) ![](/news/246.gif) ![Re: NQC programming guide -Chris Phillips (7-Dec-06 to lugnet.robotics)](/news/x.gif)
![](/news/x.gif) ![](/news/28.gif) ![](/news/x.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: NQC programming guide -lego-robotics@crynwr.com (linmix) (7-Dec-06 to lugnet.robotics)](/news/x.gif)
![](/news/x.gif) ![](/news/68.gif) ![Re: NQC programming guide -Timothy P. Smith (5-Dec-06 to lugnet.robotics)](/news/x.gif)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|