Square Wave

  1. Write a program to draw the square wave below.
  2. Observe the pattern. You can see it is a repetition of 8 periods, so you can use a for-loop to easy repeat the same pattern.
ex-square_wave.png