/scales-code-golf

Golf Scripting a function to generate a pattern of scales

Primary LanguagePython

scales-code-golf

Golf Scripting a function to print a scales pattern

The goal is to develop a function scales(n) that takes a non-negative integer n and prints a pattern of scales, in the smallest code length possible. With help from Clarence, we got the code down to 94 chars.

A few things I learned from developing this:

  1. Python doesn't need as many spaces as you might think
  2. Sometimes, you don't need to escape the escape character
  3. Learning doesn't always have to come from producing something useful
  4. Decrease and conquer

This was the sample execution for the problem:

image

This is the test output of the code developed:

image