If statement loop help

I did the knight rider circuit this website has, but I used the "for" command. Is it possible to do it with the "if statement?

for() is a loop control. if() is a conditional control.

Can you? Sure. I guess if you want an exercise in how if-statements work, then go for it.