Skip to content

Golf Scripting a function to generate a pattern of scales

Notifications You must be signed in to change notification settings

pakshuang/scales-code-golf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Golf Scripting a function to generate a pattern of scales

Topics

Resources

Stars

Watchers

Forks

Languages