It doesn't use for loops. it uses an "int buttonState" command and an "int p=1". Then each flash pattern is changed using an "if (p==1)" "if (p==2)" "if (p==3)" etc.There are delays in each of the flash patterns to get the LED's to behave properly though.
I'm not sure how attachments work here. I attached a .ino file for the code I'm working on.