77
14
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 code-golf, 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.
Is outputting an array of strings - 1 string per line - allowed? – Shaggy – 8 years ago
@Shaggy Sorry, in this case it should either return a single string with new-lines, or output the result. I've added this as rule to the challenge. – Kevin Cruijssen – 8 years ago
No worries, Kevin; was just chancing my arm to see if I could save myself a couple of bytes. – Shaggy – 8 years ago
3@Shaggy Hehe. What other reason would we have to ask question in a code-golf challenge, besides having the purpose of saving those few bytes? ;) – Kevin Cruijssen – 8 years ago
8Ha, that's awesome. I was wondering why that answer suddenly got so much attention. Thanks! – Carcigenicate – 8 years ago