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

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

It was just a bug

Inspired by the bugged output in @Carcigenicate's Clojure answer for the Print this diamond challenge.

Print this exact text:

1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1234567890
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0

(From the middle outward in both directions, each digit is separated by one more space than the previous line.)

Challenge rules:

  • There will be no input (or an empty unused input).
  • Trailing spaces are optional.
  • A single trailing new-line is optional.
  • Leading spaces or new-lines are not allowed.
  • Returning a string-array isn't allowed. You should either output the text, or have a function which returns a single string with correct result.

General rules:

  • This is , so shortest answer in bytes wins.
    Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
  • Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
  • Default Loopholes are forbidden.
  • If possible, please add a link with a test for your code.
  • Also, please add an explanation if necessary.

Answer*

Draft saved
Draft discarded
Cancel
11
  • 5
    \$\begingroup\$ 59 bytes \$\endgroup\$ Commented Jul 3, 2017 at 7:30
  • 26
    \$\begingroup\$ This is farm more impressive than 25 bytes in any golfing language imho. \$\endgroup\$ Commented Jul 3, 2017 at 9:30
  • 4
    \$\begingroup\$ @Jylo Thanks, but the 25 byte-solutions are very impressive, since they show lots of golfing efforts made by their authors. You should first know what each character in their source means, and then you will understand how beautifully golfed they are. \$\endgroup\$ Commented Jul 3, 2017 at 9:33
  • 3
    \$\begingroup\$ @JasonChen No, Python does not allow that syntax, because that's specific to C-like languages. \$\endgroup\$ Commented Jul 4, 2017 at 20:11
  • 5
    \$\begingroup\$ Possible inspiration: Can be done without exec in 55 bytes as well. Used a similar approach to get Python 3 down to 57 bytes. Didn't see any obvious way to get it shorter, by omitting exec, but figured I'd mention it as a possibility. \$\endgroup\$ Commented Jul 6, 2017 at 2:27

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