How about a boolean matrix? On Fri, Oct 29, 2010 at 1:39 PM, acr <acr...@gmail.com> wrote: > thanks, I do understand, but I love to hate the pain.. Im rocking and > rolling here, but there are some things I run into that I know more > experience will fix.. but that's how I learn, I just hit a bump. > > On Oct 29, 12:20 pm, DanH <danhi...@ieee.org> wrote: >> It should be pointed out that this is a basic Java question, not an >> Android question. And more to the point it's a basic programming >> question. >> >> You'd be far better off learning more about programming on a desktop >> system before digging into the ugliness that is Android (or any other >> phone platform). It will be much less frustrating for you. >> >> On Oct 29, 10:55 am, acr <acr...@gmail.com> wrote: >> >> > Hi all, Im new to android and java but moving along at full speed. My >> > lack of experience is making some elementary tasks too repetitive. >> >> > For example I want to be able to loop through the following snipit of >> > code.. the problem is I want "i" replace the number "1" in g1m0+=1; >> > so through each iteration g1m0 would become g2mo >> >> > for (Graphic grap : _toCompare) { >> > for(int i=1;i<=7;i++){ >> > if(grap.getCol()==i && grap.getRow()==1){ >> > g1m0+=1; >> > }else if(grap.getCol()==i && grap.getRow()==2){ >> > g1m0+=1; >> > g1m1+=1; >> > }else if(grap.getCol()==i && grap.getRow()==3){ >> > ...... >> >> > I know this is a simple to the novices out there can you please give >> > me some insight to shorten up my code here.. >> >> > Thanks a bunch! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en
-- If you want freedom, compile the source. Sebastián Treu http://labombiya.com.ar -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en