R
Roedy Green
What else can be done to improve the above code.
see http://mindprod.com/jgloss/codingconventions.html
Arrays should start with a lower case letter.
What else can be done to improve the above code.
u1=i+1;u2=j+1;
if ((u1<9)&&(u2<9)) {
ux=u1*3+u2;
if (Arr1[ux]=='B') {mz++;BigARRAY[mz]=ux;}
}
Roedy said:I would find the following code a lot easier to read..
u1 = i + 1;
u2 = j + 1;
if ( u1 < 9 && u2 < 9 )
{
ux = u1 * 3 + u2;
if ( arr1[ ux ] == 'B' )
{
mz++;
bigArray[ mz ] = ux;
}
In your version, my linear rational brain has to do the tokenising.
In mine, my parallel-processing visual cortex does it.
Sanny said:I have a below code I use a lot in my Java Program.
Secondly
BigARRAY[++mz] is it same as
mz++;BigARRAY[mz]
And what about BigARRAY[mz++] is it same as
mz++;BigARRAY[mz]
Donkey said:Secondly
BigARRAY[++mz] is it same as
mz++;BigARRAY[mz]
Logically it is, and I guess performace wise too it is.
And what about BigARRAY[mz++] is it same as
mz++;BigARRAY[mz]
Absolutely not. In the first case, if mz is initially 1 then 1st case will
result to BigARRAY[1], but in 2nd case it will be BigARRAY[2]
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.