Skip to main content
-4 bytes
Source Link
R. Kap
  • 4.9k
  • 2
  • 15
  • 37

Python 2.7, 110 99 9595 91 bytes:

G=input();i=1;exec"print' '*[~-i,G][i>G]+'-'+[str(i)*%s-'%[`i`*(2*-~G-i*2),'10'][(i>9)*G>9]+'-';i+=1;"*10*G>9];i+=1;"*10

A full program that takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Try It Online! (Ideone)

Python 2.7, 110 99 95 bytes:

G=input();i=1;exec"print' '*[~-i,G][i>G]+'-'+[str(i)*(2*-~G-i*2),'10'][(i>9)*G>9]+'-';i+=1;"*10

A full program that takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Try It Online! (Ideone)

Python 2.7, 110 99 95 91 bytes:

G=input();i=1;exec"print' '*[~-i,G][i>G]+'-%s-'%[`i`*(2*-~G-i*2),'10'][(i>9)*G>9];i+=1;"*10

A full program that takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Try It Online! (Ideone)

deleted 9 characters in body
Source Link
R. Kap
  • 4.9k
  • 2
  • 15
  • 37

Python 2.7, 110 9999 95 bytes:

lambda G:'\n'.joinG=input([');i=1;exec"print' '*[~-i,G][i>G]+'-'+[`i`*'+[str(i)*(2*-~G-i*2),'10'][(i>9)*G>9]+'-'for i in range(1,11)])';i+=1;"*10

An anonymous Lambda functionA full program that takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Try It Online! (Ideone)

Python 2.7, 110 99 bytes:

lambda G:'\n'.join([' '*[~-i,G][i>G]+'-'+[`i`*(2*-~G-i*2),'10'][(i>9)*G>9]+'-'for i in range(1,11)])

An anonymous Lambda function that takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Try It Online! (Ideone)

Python 2.7, 110 99 95 bytes:

G=input();i=1;exec"print' '*[~-i,G][i>G]+'-'+[str(i)*(2*-~G-i*2),'10'][(i>9)*G>9]+'-';i+=1;"*10

A full program that takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Try It Online! (Ideone)

added 69 characters in body
Source Link
R. Kap
  • 4.9k
  • 2
  • 15
  • 37

Python 2.7, 110 99 bytes:

lambda G:'\n'.join([' '*[~-i,G][i>G]+'-'+[`i`*(2*-~G-i*2),'10'][(i>9)*G>9]+'-'for i in range(1,11)])

TakesAn anonymous Lambda function that takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Try It Online! (Ideone)

Python 2.7, 110 99 bytes:

lambda G:'\n'.join([' '*[~-i,G][i>G]+'-'+[`i`*(2*-~G-i*2),'10'][(i>9)*G>9]+'-'for i in range(1,11)])

Takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Python 2.7, 110 99 bytes:

lambda G:'\n'.join([' '*[~-i,G][i>G]+'-'+[`i`*(2*-~G-i*2),'10'][(i>9)*G>9]+'-'for i in range(1,11)])

An anonymous Lambda function that takes input by an integer in the inclusive range [1,10], where 10 means 100% and 1 means 10%. Can probably be golfed down a bit more.

Try It Online! (Ideone)

-11 bytes
Source Link
R. Kap
  • 4.9k
  • 2
  • 15
  • 37
Loading
Rollback to Revision 1
Source Link
R. Kap
  • 4.9k
  • 2
  • 15
  • 37
Loading
-11 bytes from adding 2 shorter solutions using Chrome as I finally got ChromeDriver working on my computer
Source Link
R. Kap
  • 4.9k
  • 2
  • 15
  • 37
Loading
Source Link
R. Kap
  • 4.9k
  • 2
  • 15
  • 37
Loading