Skip to main content
deleted 5 characters in body
Source Link
Justin Mariner
  • 5k
  • 1
  • 13
  • 18

Japt, 12 bytes

òV
£¯Y ¬ç +X

Works for both ascendingTakes input in either order and descending numbers, depending onalways returns the inputnumbers in ascending order. Returns, as an array of lines.

Try it online! with the -R flag to join the array with newlines.

Explanation

Implicit input of U and V.

òV
£

Create inclusive range [U, V] and map each value to...

¯Y ¬ç

The values before the current (¯Y), joined to a string (¬) and filled with spaces (ç).

+X

Plus the current number. Resulting array is implicitly output.

Japt, 12 bytes

òV
£¯Y ¬ç +X

Works for both ascending and descending numbers, depending on the input order. Returns an array of lines.

Try it online! with the -R flag to join the array with newlines.

Explanation

Implicit input of U and V.

òV
£

Create inclusive range [U, V] and map each value to...

¯Y ¬ç

The values before the current (¯Y), joined to a string (¬) and filled with spaces (ç).

+X

Plus the current number. Resulting array is implicitly output.

Japt, 12 bytes

òV
£¯Y ¬ç +X

Takes input in either order and always returns the numbers in ascending order, as an array of lines.

Try it online! with the -R flag to join the array with newlines.

Explanation

Implicit input of U and V.

òV
£

Create inclusive range [U, V] and map each value to...

¯Y ¬ç

The values before the current (¯Y), joined to a string (¬) and filled with spaces (ç).

+X

Plus the current number. Resulting array is implicitly output.

added 305 characters in body
Source Link
Justin Mariner
  • 5k
  • 1
  • 13
  • 18

Japt, 12 bytes

òV
£¯Y ¬ç +X

Works for both ascending and descending numbers, depending on the input order. Returns an array of lines.

Try it online! with the -R flag to join the array with newlines.

Explanation

Implicit input of U and V.

òV
£

Create inclusive range [U, V] and map each value to...

¯Y ¬ç

The values before the current (¯Y), joined to a string (¬) and filled with spaces (ç).

+X

Plus the current number. Resulting array is implicitly output.

Japt, 12 bytes

òV
£¯Y ¬ç +X

Works for both ascending and descending, depending on the input order. Returns an array of lines.

Try it online! with the -R flag to join the array with newlines.

Japt, 12 bytes

òV
£¯Y ¬ç +X

Works for both ascending and descending numbers, depending on the input order. Returns an array of lines.

Try it online! with the -R flag to join the array with newlines.

Explanation

Implicit input of U and V.

òV
£

Create inclusive range [U, V] and map each value to...

¯Y ¬ç

The values before the current (¯Y), joined to a string (¬) and filled with spaces (ç).

+X

Plus the current number. Resulting array is implicitly output.

Source Link
Justin Mariner
  • 5k
  • 1
  • 13
  • 18

Japt, 12 bytes

òV
£¯Y ¬ç +X

Works for both ascending and descending, depending on the input order. Returns an array of lines.

Try it online! with the -R flag to join the array with newlines.