The Water Cycle Algorithm (WCA) is inspired by water cycle process in nature, flowing rivers and streams to the sea and surface run-off phase in water cycle process. Based on this idea, the WCA is modeled and proposed for solving unconstrained and constrained optimization problems. The provided source codes are the required files for solving constrained problems using the WCA. Talking about constraint handling strategy, feasible approach has been implemented in the WCA. Readers may use penalty approach in unconstrained WCA for tackling constrained optimization problems.