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

#JavaScript (ES6), 218 (削除) 220 232 (削除ここまで)

JavaScript (ES6), 218 (削除) 220 232 (削除ここまで)

Edit I was using u and t to keep track of the top and leftmost position, but I realized that t is not needed at all

w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?a=n-13?n-30?a:!(b=-1):!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?a=n-13?n-30?a:!(b=-1):!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words!' oninput='update()'>
<pre id=O></pre>

#JavaScript (ES6), 218 (削除) 220 232 (削除ここまで)

Edit I was using u and t to keep track of the top and leftmost position, but I realized that t is not needed at all

w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?a=n-13?n-30?a:!(b=-1):!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?a=n-13?n-30?a:!(b=-1):!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words!' oninput='update()'>
<pre id=O></pre>

JavaScript (ES6), 218 (削除) 220 232 (削除ここまで)

Edit I was using u and t to keep track of the top and leftmost position, but I realized that t is not needed at all

w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?a=n-13?n-30?a:!(b=-1):!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?a=n-13?n-30?a:!(b=-1):!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words!' oninput='update()'>
<pre id=O></pre>

deleted 3 characters in body
Source Link
edc65
  • 32.3k
  • 3
  • 37
  • 90

#JavaScript (ES6), 220218 (削除) 232220 232 (削除ここまで)

Edit I was using u and t to keep track of the top and leftmost position, but I realized that t is not needed at all

w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?na=n-13&&n13?n-30?0a:!(a=0,b=n-13?b=-1):1!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?na=n-13&&n13?n-30?0a:!(a=0,b=n-13?b=-1):1!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>'' oninput='update()'>
<pre id=O></pre>

#JavaScript (ES6), 220 (削除) 232 (削除ここまで)

Edit I was using u and t to keep track of the top and leftmost position, but I realized that t is not needed at all

w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?n-13&&n-30?0:(a=0,b=n-13?-1:1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?n-13&&n-30?0:(a=0,b=n-13?-1:1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>' oninput='update()'>
<pre id=O></pre>

#JavaScript (ES6), 218 (削除) 220 232 (削除ここまで)

Edit I was using u and t to keep track of the top and leftmost position, but I realized that t is not needed at all

w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?a=n-13?n-30?a:!(b=-1):!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?a=n-13?n-30?a:!(b=-1):!(b=1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words!' oninput='update()'>
<pre id=O></pre>

added 96 characters in body
Source Link
edc65
  • 32.3k
  • 3
  • 37
  • 90

#JavaScript (ES6), 232220 (削除) 232 (削除ここまで)

Edit I was using u and t to keep track of the top and leftmost position, but I realized that t is not needed at all

w=>[...w].map(c=>t=c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?n-13&&n-30?0:(a=0,b=n-13?-1:1):(b=0,a=n/3-8),u=(y+=b,x+=a)<u?x:u,y+=b)<t?y:t,a=1,b=0,x=y=u=t=wx=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = t = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b, t = y<t? y : t
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>t=c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?n-13&&n-30?0:(a=0,b=n-13?-1:1):(b=0,a=n/3-8),u=(y+=b,x+=a)<u?x:u,y+=b)<t?y:t,a=1,b=0,x=y=u=t=wx=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>' oninput='update()'>
<pre id=O></pre>

#JavaScript (ES6), 232

w=>[...w].map(c=>t=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?n-13&&n-30?0:(a=0,b=n-13?-1:1):(b=0,a=n/3-8),u=(x+=a)<u?x:u,y+=b)<t?y:t,a=1,b=0,x=y=u=t=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = t = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b, t = y<t? y : t
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>t=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?n-13&&n-30?0:(a=0,b=n-13?-1:1):(b=0,a=n/3-8),u=(x+=a)<u?x:u,y+=b)<t?y:t,a=1,b=0,x=y=u=t=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>' oninput='update()'>
<pre id=O></pre>

#JavaScript (ES6), 220 (削除) 232 (削除ここまで)

Edit I was using u and t to keep track of the top and leftmost position, but I realized that t is not needed at all

w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?n-13&&n-30?0:(a=0,b=n-13?-1:1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z

Less golfed

w=>{
 a = 1, b = 0;
 x = y = u = w.length;
 g = [];
 [...w].map(c => (
 r = g[y]||[],
 r[x] = c,
 g[y] = r,
 n = parseInt(c,36)|0,
 n-21 && n-27 ? n-13 && n-30?0 : (a=0, b=n-13?-1:1) : (b=0, a=n/3-8),
 x += a, u = x<u? x : u,
 y += b
 ))
 z=''
 g.map(r=>[...r.slice(u)].map(c=>z += c||' ', z += '\n'))
 return z
} 

Test

F=
w=>[...w].map(c=>u=(((g[y]=g[y]||[])[x]=c,n=parseInt(c,36)|0)-21&&n-27?n-13&&n-30?0:(a=0,b=n-13?-1:1):(b=0,a=n/3-8),y+=b,x+=a)<u?x:u,a=1,b=0,x=y=u=w.length,g=[])+g.map(r=>[...r.slice(u)].map(c=>z+=c||' ',z+=`
`),z='')&&z
function update() {
 w=I.value
 O.textContent=F(w)
}
update()
#I {width:90%}
<input id=I value='It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>' oninput='update()'>
<pre id=O></pre>

added 816 characters in body
Source Link
edc65
  • 32.3k
  • 3
  • 37
  • 90
Loading
Source Link
edc65
  • 32.3k
  • 3
  • 37
  • 90
Loading

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