Skip to main content
Commonmark migration
Source Link

#JavaScript (ES8), 69 67 62 bytes

JavaScript (ES8), 69 67 62 bytes

Takes input as integers, in ascending order, using currying syntax. Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

##Try it

Try it

o.innerText=(f=

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

)(i.value=93)(j.value=105).join`\n`
oninput=_=>o.innerText=f(Math.min(i.value,j.value))(Math.max(i.value,j.value)).join`\n`
label,input{font-family:sans-serif}input{margin:0 5px 0 0;width:100px;}
<label for=i>x: </label><input id=i type=number><label for=j>y: </label><input id=j type=number><pre id=o>

#JavaScript (ES8), 69 67 62 bytes

Takes input as integers, in ascending order, using currying syntax. Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

##Try it

o.innerText=(f=

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

)(i.value=93)(j.value=105).join`\n`
oninput=_=>o.innerText=f(Math.min(i.value,j.value))(Math.max(i.value,j.value)).join`\n`
label,input{font-family:sans-serif}input{margin:0 5px 0 0;width:100px;}
<label for=i>x: </label><input id=i type=number><label for=j>y: </label><input id=j type=number><pre id=o>

JavaScript (ES8), 69 67 62 bytes

Takes input as integers, in ascending order, using currying syntax. Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

Try it

o.innerText=(f=

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

)(i.value=93)(j.value=105).join`\n`
oninput=_=>o.innerText=f(Math.min(i.value,j.value))(Math.max(i.value,j.value)).join`\n`
label,input{font-family:sans-serif}input{margin:0 5px 0 0;width:100px;}
<label for=i>x: </label><input id=i type=number><label for=j>y: </label><input id=j type=number><pre id=o>

added 697 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript (ES7ES8), 69 67 62 bytes

Takes input as integers, in ascending order, using currying syntax. Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

##Try it

o.innerText=(f=

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

)(i.value=93)(j.value=105).join`\n`
oninput=_=>o.innerText=f(Math.min(i.value,j.value))(Math.max(i.value,j.value)).join`\n`
label,input{font-family:sans-serif}input{margin:0 5px 0 0;width:100px;}
<label for=i>x: </label><input id=i type=number><label for=j>y: </label><input id=j type=number><pre id=o>

#JavaScript (ES7), 69 67 62 bytes

Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

#JavaScript (ES8), 69 67 62 bytes

Takes input as integers, in ascending order, using currying syntax. Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

##Try it

o.innerText=(f=

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")

)(i.value=93)(j.value=105).join`\n`
oninput=_=>o.innerText=f(Math.min(i.value,j.value))(Math.max(i.value,j.value)).join`\n`
label,input{font-family:sans-serif}input{margin:0 5px 0 0;width:100px;}
<label for=i>x: </label><input id=i type=number><label for=j>y: </label><input id=j type=number><pre id=o>

deleted 199 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript (ES7), 69 6767 62 bytes

Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>""_=>s="".padEnd(s.length)+(s+=x,x++),s="")

I had this golfed down to 62 bytes but felt it was too similar to tsh's solution so went with my original. The 62 byte version is:

x=>y=>[...Array(++y-x)].map(_=>s=s.replace(/./g,' ')+x++,s="")

#JavaScript (ES7), 69 67 bytes

Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>"".padEnd(s.length)+(s+=x,x++),s="")

I had this golfed down to 62 bytes but felt it was too similar to tsh's solution so went with my original. The 62 byte version is:

x=>y=>[...Array(++y-x)].map(_=>s=s.replace(/./g,' ')+x++,s="")

#JavaScript (ES7), 69 67 62 bytes

Returns an array of strings.

x=>y=>[...Array(++y-x)].map(_=>s="".padEnd(s.length)+x++,s="")
added 8 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading
added 204 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading