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
4
  • 4
    \$\begingroup\$ In a compact language like this it seriously takes two bytes to add one? \$\endgroup\$ Commented Jul 4, 2017 at 12:05
  • 3
    \$\begingroup\$ @aschepler Yes. APL is not a golfing language, and doesn't have an increment primitive. J does, but it takes two bytes; >:. \$\endgroup\$ Commented Jul 4, 2017 at 12:07
  • 6
    \$\begingroup\$ APL is not a golfing language ... ↑⊃¨,/¨(1+|¯9+⍳17)↑¨¨⊂1⌽⎕D ... ಠ_ಠ \$\endgroup\$ Commented Jul 6, 2017 at 15:54
  • 1
    \$\begingroup\$ @Alexander Thanks for getting my attention back to this one. I could golf 3 bytes. \$\endgroup\$ Commented Jul 6, 2017 at 15:59

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