For random behavior in a for loop, you can change something like x++ to something like x += random(somenumber)