Processing codes (moving objects at the edge)

How can i make an object move in processing 1.5.1? I had this project in my IT class. Then, we are tasked to make the square move at the edges(from left to right, up to bottom, right to left and bottom to up), not using state variable. Help me please! Thanks.
