Post History
JavaScript, 47 bytes n=>`0`.repeat(n)+(` 0`.padEnd(n--)+0).repeat(n) Try it online! My first pass used recursion before I realised I was over thinking things! First 51 byte version inclu...
Answer
#2: Post edited
- # JavaScript, 47 bytes
- <!-- language-all: lang-javascript -->
- n=>`0`.repeat(n)+(`
- 0`.padEnd(n--)+0).repeat(n)
[Try it online!](https://tio.run/##RckxDoAgDADA3Ze0IRB8AG7@AyLFaEhLgPj96uZ4uTs9aRz9atOyZNISlMMWfXSdGqUJjAbi8rmlvHMGthaNx7/1EB5SyVU5ocDqEfUF "JavaScript (Node.js) – Try It Online")
- # JavaScript, 47 bytes
- <!-- language-all: lang-javascript -->
- n=>`0`.repeat(n)+(`
- 0`.padEnd(n--)+0).repeat(n)
- [Try it online!](https://tio.run/##RckxDoAgDADA3Ze0IRB8AG7@AyLFaEhLgPj96uZ4uTs9aRz9atOyZNISlMMWfXSdGqUJjAbi8rmlvHMGthaNx7/1EB5SyVU5ocDqEfUF "JavaScript (Node.js) – Try It Online")
- My first pass used recursion before I realised I was over thinking things! First 51 byte version includes a leading newline, second 52 byte version was in case that wasn't allowed.
- f=(n,x=n)=>x?f(n,--x)+`
- 0`.padEnd(n,` 0`[+!x])+0:``
- [Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/zVYjT6fCNk/T1q7CPg3I1tWt0NRO4DJI0CtITHHNSwEKJSgYJERrK1bEamobWCUk/E/OzyvOz0nVy8lP10jTMDTQ1PwPAA)
- f=(n,x=n)=>--x?f(n,x)+`
- 0`.padEnd(n)+0:`0`.repeat(n)
- [Try it online!](https://tio.run/##FcdLCoAgEADQfSdxMMO2gbXqHg5@opBRVMLbm73de/DFYvKdqqBoXe9eMZqbIlC7EO3w/4DrSeoloT3JMgIuNz2eXXJYx7uJVGJwS4gX82yVAP0D)
#1: Initial revision
# JavaScript, 47 bytes <!-- language-all: lang-javascript --> n=>`0`.repeat(n)+(` 0`.padEnd(n--)+0).repeat(n) [Try it online!](https://tio.run/##RckxDoAgDADA3Ze0IRB8AG7@AyLFaEhLgPj96uZ4uTs9aRz9atOyZNISlMMWfXSdGqUJjAbi8rmlvHMGthaNx7/1EB5SyVU5ocDqEfUF "JavaScript (Node.js) – Try It Online")