CLS x = 12 ' ball X coordinate y = 7 ' ball Y coordinate xs = 1 ' speed on X direction ys = 1 ' speed on Y direction 1 LOCATE y, x ' erase ball PRINT " " x = x + xs ' calculate new ball coordinates y = y + ys LOCATE y, x ' draw ball PRINT "O" IF x > 79 THEN xs = -1: SOUND 1000, 1 ' check for boundaries IF x < 2 THEN xs = 1: SOUND 1000, 1 IF y > 22 THEN ys = -1: SOUND 1000, 1 IF y < 2 THEN ys = 1: SOUND 1000, 1 SOUND 0, 1 ' wait GOTO 1