Programming Patterns: Step 1 – Square algorithm