We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi somewhat novice programmer. I am trying to get every other element from an array or loop actually.
for(int i =0;i<5;i++){
println(i);
}
//it prints 0,1,2,3,4
is there a function to get it to print 0,2,4 and then a way to invert it to get 1,3...so I can draw a line through a 2d array. thanks.
Answers
@jjdelorimier== that 's easy
Nicer with some spaces, IMHO...
i++
is, somehow, a shortcut toi += 1
, so you can make increments of any size.Thanks guys appreciate it!