Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

###Ruby, 46 characters###

Ruby, 46 characters

puts" "*8+?*;9.times{|i|puts"%8s0"%(v=?0*i)+v}

In order to change the height you would have to change both 8s and of course also the 9. The output of the program is as follows:

 *
 0
 000
 00000
 0000000
 000000000
 00000000000
 0000000000000
 000000000000000
00000000000000000

Edit: Inexcusably I omitted the output in the first submission.

###Ruby, 46 characters###

puts" "*8+?*;9.times{|i|puts"%8s0"%(v=?0*i)+v}

In order to change the height you would have to change both 8s and of course also the 9. The output of the program is as follows:

 *
 0
 000
 00000
 0000000
 000000000
 00000000000
 0000000000000
 000000000000000
00000000000000000

Edit: Inexcusably I omitted the output in the first submission.

Ruby, 46 characters

puts" "*8+?*;9.times{|i|puts"%8s0"%(v=?0*i)+v}

In order to change the height you would have to change both 8s and of course also the 9. The output of the program is as follows:

 *
 0
 000
 00000
 0000000
 000000000
 00000000000
 0000000000000
 000000000000000
00000000000000000

Edit: Inexcusably I omitted the output in the first submission.

added 305 characters in body
Source Link
Howard
  • 23.6k
  • 2
  • 45
  • 83

###Ruby, 46 characters###

puts" "*8+?*;9.times{|i|puts"%8s0"%(v=?0*i)+v}

In order to change the height you would have to change both 8s and of course also the 9. The output of the program is as follows:

 *
 0
 000
 00000
 0000000
 000000000
 00000000000
 0000000000000
 000000000000000
00000000000000000

Edit: Inexcusably I omitted the output in the first submission.

###Ruby, 46 characters###

puts" "*8+?*;9.times{|i|puts"%8s0"%(v=?0*i)+v}

In order to change the height you would have to change both 8s and of course also the 9.

###Ruby, 46 characters###

puts" "*8+?*;9.times{|i|puts"%8s0"%(v=?0*i)+v}

In order to change the height you would have to change both 8s and of course also the 9. The output of the program is as follows:

 *
 0
 000
 00000
 0000000
 000000000
 00000000000
 0000000000000
 000000000000000
00000000000000000

Edit: Inexcusably I omitted the output in the first submission.

Source Link
Howard
  • 23.6k
  • 2
  • 45
  • 83

###Ruby, 46 characters###

puts" "*8+?*;9.times{|i|puts"%8s0"%(v=?0*i)+v}

In order to change the height you would have to change both 8s and of course also the 9.

AltStyle によって変換されたページ (->オリジナル) /