Posts Tagged With: code

Alternating directions

Just a quick thought :) If you want to alternate between -1 and 1 in a for-loop, say for the purpose of changing direction or something similar, and you don’t want to add an extra variable to manually alternate in each run-through, this works just fine: for (int i=0; i < something; i++){ dir = &hellip Continue reading »

Categories: Code | Tags: | 103 Comments