g | x | w | all
Bytes Lang Time Link
003Vyxal 3250819T080555Zlyxal
006APLNARS250819T075653ZRosario
014tinylisp 2230201T181348ZDLosc
044Swift 5.9240312T155737ZmacOSist
013Juby230614T151609ZJordan
007Uiua SBCS240312T153508Zchunes
007Pip p240312T051746ZDLosc
003Thunno 2230622T175105ZThe Thon
020Wolfram Language Mathematica200211T144010ZZaMoC
018Arturo230129T123716Zchunes
004Nekomata230614T035751Zalephalp
021Julia 1.0230202T180127ZAshlin H
012Pip230202T155814ZBaby_Boy
042Swift 5.6+230202T022115ZBbrk24
025FunStack alpha230201T212149ZDLosc
058Erlang230201T005510ZYuri Gin
002Nibbles230130T230100ZAdam
003Vyxal230130T020136Zlyxal
060JavaScript230129T234105ZEzioMerc
046shell with seq loop230129T204538Zgildux
105Go230129T193924Zbigyihsu
045Elm230129T165405ZKirill L
005Pyt230129T164916ZKip the
010BQN230129T155857ZJacobus
006Stax200220T181400ZNanajnai
145TSQL200217T145947Zt-clause
008K ngn/k200212T154400Zscrawl
047Fortran GFortran200213T205241ZDeathInc
009Burlesque200213T204751ZDeathInc
029Coffeescript200213T195415ZPenagwin
022Zsh200213T153937ZGammaFun
098Java JDK200213T145826ZOlivier
037Kotlin200213T041843Zsnail_
010200211T214401ZSirBogma
042C gcc200212T192041ZDigital
027Haskell200213T010144ZCurry Ba
051Haskell200211T215015ZMatthew
012x8616 machine code200211T224605Z640KB
036Clojure200212T103929ZKirill L
004MathGolf200212T102034ZKevin Cr
005Brachylog200212T100911ZFatalize
011J200212T072940ZGalen Iv
003Jelly200211T143310ZRGS
013Raku200211T225212ZJo King
020Retina200211T223226ZNeil
054PHP200211T163943Z640KB
030Ruby200211T153340ZG B
049JavaScript ES6200211T150845ZArnauld
054PHP200211T204515ZGuillerm
019R200211T164703ZGiuseppe
045Factor200211T190009ZGalen Iv
054C gcc200211T184918ZS.S. Ann
009Charcoal200211T184901ZNeil
004Japt200211T181351ZShaggy
015shell + sed200211T164957Zuser4180
004APL Dyalog Unicode200211T144414ZAdá
00305AB1E200211T161535ZGrimmy
029Pure Bash no external utilities200211T161306ZDigital
046Python 3200211T145611ZNoodle9
1213GolfScript200211T153301ZMathgeek
005Pyth200211T151513ZCitty
046Python 3200211T150011ZJitse
019PowerShell200211T144134ZAdmBorkB

Vyxal 3, 3 bytes

ɾɾV

Vyxal It Online!

Original question poster is still the greatest code golfer I've ever known.

APL(NARS), 6 chars

⌽¨⍳¨⍳⎕

input one number >0 output one list of list of numbers.

test:

  ⌽¨⍳¨⍳⎕
⎕:
  4
┌4──────────────────────────────┐
│┌1─┐ ┌2───┐ ┌3─────┐ ┌4───────┐│
││ 1│ │ 2 1│ │ 3 2 1│ │ 4 3 2 1││
│└~─┘ └~───┘ └~─────┘ └~───────┘2
└∊──────────────────────────────┘

tinylisp 2, 14 bytes

(.(p m to1)1to

Try It Online!

Explanation

(.(p m to1)1to)
  (p      )      ; Partially apply
     m           ;  the map function
       to1       ;  to the to1 function (given N, return the list of numbers from
                 ;  N down to 1)
(.            )  ; Compose that with
           1to   ; the 1to function (given N, return the list of numbers from
                 ; 1 up to N)

The result is an anonymous function that takes one argument N; generates the range from 1 to N; and then for each of those numbers, generates the range from it down to 1.

Swift 5.9, 44 bytes

let f={(1...$0).map{(1...$0).reversed()+[]}}

J-uby, 19 13 bytes

:+|:*&(:+|:~)

Attempt This Online!

Explanation

:+ | :* & (:+ | :~)
:+ |                 # Range 1..input, then
     :* & (       )  # Map with...
           :+ | :~   #   Range 1..n, then reverse

Uiua SBCS, 7 bytes

¯⍚⇌⍚⇡⇡¯

Try it!

¯⍚⇌⍚⇡⇡¯
      ¯  # negate
     ⇡   # range
   ⍚⇡    # range w/ boxing
 ⍚⇌      # reverse each
¯        # negate

Pip -p, 7 bytes

R*\,\,a

Attempt This Online!

Explanation

R*\,\,a
      a  ; Command-line argument
    \,   ; Inclusive range from 1 to that number
  \,     ; Inclusive range from 1 to each of those numbers
R*       ; Reverse each

Thunno 2, 3 bytes

RRṃ

Attempt This Online!

Explanation

RRṃ  # Implicit input   ->  5
R    # Push [1..input]  ->  [1 2 3 4 5]
 R   # Push [1..each]   ->  [[1] [1 2] [1 2 3] [1 2 3 4] [1 2 3 4 5]]
  ṃ  # Reverse each     ->  [[1] [2 1] [3 2 1] [4 3 2 1] [5 4 3 2 1]]
     # Implicit output

Wolfram Language (Mathematica), 20 bytes

Range[Range@#,1,-1]&

Try it online!

-3 bytes from @att

Arturo, 22 18 bytes

$=>[map&=>[@&..1]]

Try it

Nekomata, 4 bytes

RRᵐ↔

Attempt This Online!

R       Range
 R      Range
  ᵐ     Map
   ↔    Reverse

Julia 1.0, 27 21 bytes

~n=1:n.|>i->[i:-1:1;]

Try it online!

-6 bytes (!!) thanks to MarcMush: Replace map with a broadcast .|>

Pip, -p 12 bytes

Fl\,aO R\,lx

How?

Fl\,aO R\,lx  : One arg; int
    a         : First input(max for range)
Fl            : For each in:
  \,a         : Range from 1 to a
        \,l     : Range from 1 to l(int from range)
       R        : Reverse
     O          : Output
           x  : Trigger output

Try It Online!

Swift 5.6+, 42 bytes

{(1...$0).map{n->[_]in(1...n).reversed()}}

Type information (here ->[_]) is required. Without it, the return type is [ReversedCollection<ClosedRange<_>>], as the range primitive's .reversed() method is lazy by default.

SwiftFiddle link with both ways (with and without type info) to highlight the difference.

This technically isn't even full type info, as the actual type of number used is left unspecified, as _. It doesn't even necessarily have to be a builtin type as long as it meets certain requirements. With full generics, the function might look something like this (ungolfed):

func f<T: Strideable & ExpressibleByIntegerLiteral>(_ n: T) -> [[T]]
where T.Stride: SignedInteger {
    return (1 ... n).map { i in
        (1 ... i).reversed()
    }
}

FunStack alpha, 25 bytes

Reverse map IFrom1 IFrom1

Try it at Replit!

Explanation

                   IFrom1  Inclusive range from 1 to the argument
            IFrom1         Inclusive range from 1 to each of those numbers
Reverse map                Reverse each sublist

Erlang 58 bytes

f(N)->[lists:reverse(lists:seq(1,X))||X<-lists:seq(1,N)].

Nibbles, 2 bytes

,$\,

Attempt This Online!

  Map
,  range
$   input (each line)
\  reverse
,   range
     it

Vyxal, 3 bytes

ɾɾR

Try it Online!

Can't believe I never answered this challenge despite the fact it was asked by one of the greatest golfers I ever knew

Explained

ɾɾR
ɾ   # the range [1, input] 
 ɾ  # and that for each item in the range
  R # vectorised reverse

JavaScript, 60 bytes

Without recursion:

n=>eval('for(a=[];n;a[--n]=b)for(b=[j=n];j-->1;b[n-j]=j);a')

Try it:

f=n=>eval('for(a=[];n;a[--n]=b)for(b=[j=n];j-->1;b[n-j]=j);a')

console.log(JSON.stringify(f(1)));
console.log(JSON.stringify(f(2)));
console.log(JSON.stringify(f(3)));
console.log(JSON.stringify(f(4)));

shell with seq loop, 46 bytes

for n in `seq $1`;do seq -s\  -t'\n' $n 1;done

Go, 105 bytes

func(n int)(o[][]int){for i:=1;i<=n;i++{J:=[]int{}
for j:=i;j>0;j--{J=append(J,j)}
o=append(o,J)}
return}

Attempt This Online!

Elm, 45 bytes

r=List.range 1
f=List.map(List.reverse<<r)<<r

Try it on Ellie

Pyt, 5 bytes

řĐř-⁺

Try it online!

Code worked on input of 3:

Code Stack Description
ř [1,2,3] implicit input; řangify [1,2,...,n]
Đ [1,2,3] [1,2,3] Đuplicate
ř [1,2,3] [[1],[1,2],[1,2,3]] řangify
- [[0],[1,0],[2,1,0]] subtract
[[1],[2,1],[3,2,1]] increment; implicit print

BQN, 10 bytes

Anonymous tacit prefix function.

(⌽1+↕)¨1+↕

Try it online!

Explanation

(⌽1+↕)¨1+↕
       1+↕    1.  Get list of integers from 1 to n.
      ¨       2a. For each integer i in the list...
( 1+↕)        2b. get a list of integers from 1 to i...
(⌽   )        2c. and then reverse that list.

Stax, 6 bytes

RmRr|u

Run and debug it

T-SQL, 145 bytes

WITH a(n)as(SELECT number FROM spt_values
WHERE'p'=type)SELECT string_agg(@+1-a.n,' ')FROM
a,a b WHERE a.n<=@ and b.n<a.n
GROUP BY b.n ORDER BY 1

Try it online

K (ngn/k), 8 bytes

|',\1+!:

Try it online!

-2 thanks to ngn :-)

Fortran (GFortran), 47 bytes

read*,i
print*,("{",(j,j=k,1,-1),"}",k=1,i)
end

Try it online!

Could remove 8 chars by getting rid of printed brackets if anyone would believe that they are lists otherwise.

Burlesque, 9 bytes

riroq<-pa

Try it online!

ri  # Read int
ro  # Range [1,N]
q<- # Boxed reverse
pa  # Operate over ((1), (1 2), (1 2 3),...)

Alternative 9 byter, but this also has an empty list as the first element:

riroiT)<-

Coffeescript, 29 bytes

r=(x)->[[y..1]for y in[1..x]]

Try it online!

Zsh, 22 bytes

eval echo {{1..$1}..1}

Try it online!

{{1..$1}..1} -> {1..1} {2..1} {3..1} {4..1} ...

eval echo {1..1} {2..1} {3..1} ... -> echo 1 2 1 3 2 1 ...

If the sublists must be delimited, then 25 bytes for , or 26 bytes for newline.

Java (JDK), 98 bytes

n->{int a[][]=new int[n][],i=0,j;for(;i<n;)for(a[i]=new int[j=++i];j>0;)a[i-1][--j]=i-j;return a;}

Try it online!

Kotlin, 37 bytes

{(1..it).map{(it downTo 1).toList()}}

Try it online!

Perl 6 Raku, 24 15 13 10 bytes

-2 removed parenthesis

-3 thanks to nwellnhof

^*+1 X…1

Try it online!

Explanation

^*+1     # make a range from 1 .. argument (whatever star).
     X…1 # create ranges descending to 1 using cross product metaoperator.

Previous version, 24 bytes

(^<<(^*+1)X+1)>>.reverse

Try it online!

Explanation

     ^*+1                # make a range from 1 .. argument (whatever star)
 ^<<(    )               # replace each element with a range from 0 .. element - 1
                         # (via hyper prefix operator)
          X+1            # shift the range to 1 .. element
                         # (via cross product metaoperator)
(            )>>.reverse # reverse each list (via hyper method operator)

C (gcc), 42

I felt like there must be an elegant recursive solution to this. This is the shortest I could come up with, though there is probably more room for golf.

f(n,m){n&&f(n-m/n,m%n+1)*printf("%d ",m);}

Initially, the function is called as f(N, 1), where N is the input integer.

Try it online!

Haskell, 27 bytes

f n=scanl(flip(:))[1][2..n]

Haskell, 74 73 51 bytes

main=do i<-getLine;print[[x,x-1..1]|x<-[1..read i]]

Try it online!

-22 bytes thanks to @79037662

x86-16 machine code, 12 bytes

Binary:

00000000: 33c0 4050 ab48 75fc 58e2 f7c3         3.@P.Hu.X...

Unassembled listing:

33 C0       XOR  AX, AX         ; AX = 0
        OUT_LOOP:
40          INC  AX             ; start at 1
50          PUSH AX             ; save starting position
        IN_LOOP:
AB          STOSW               ; write to output buffer, increment DI
48          DEC  AX             ; AX--
75 FC       JNZ  IN_LOOP        ; if AX > 0, keep looping
58          POP  AX             ; restore starting position
E2 F7       LOOP OUT_LOOP 
C3          RET                 ; return to caller

Input Number in CX, output array of WORD, at [DI].

Example I/O using DOS test driver program:

enter image description here

Clojure, 36 bytes

#(for[i(range %)](range(inc i)0 -1))

Try it online!

MathGolf, 4 bytes

╒╒mx

Try it online.

Explanation:

╒     # Push a list in the range [1, (implicit) input-integer]
 ╒    # Convert each inner value to a list in the range [1, value]
  m   # Map over this list of lists:
   x  #  And reverse each inner list
      # (after which the entire stack joined together is output implicitly as result)

Brachylog, 5 bytes

⟦₁⟧₁ᵐ

Try it online!

Explanation

⟦₁     Ascending range from 1 to the input
    ᵐ  Map:
  ⟧₁     Descending range from 1 to the mapped element

J, 11 bytes

[:<@|.\1+i.

Try it online!

         i.    a list 0..n-1
        +      add
       1       one to it -> a list 1..n
      \        for each prefix of the list (1, 1 2, 1 2 3...)
    |.         reverse
   @           and
  <            box
[:             cap the fork

K (oK), 14 bytes

{{|1+!x}'1+!x}

Try it online!

{            }  a function with parameter x
           !x   a list 0..n-1
         1+     add one to it -> a list 1..n
 {     }'       apply this function to each of the elements of the above list
     !x         a list 0..n-1
   1+           add one to it -> a list 1..n
  |             reverse

Jelly, 3 bytes

RRU
R     Range from 1 to input
 R    (implicitly) map over said range and create a range from 1 to this element
  U   reverse each of those

You can try it online!

Courtesy of @JonathanAllan, we also have two other 3-"byters"

RrL
RrE

I think it is not often that golfing languages solve a challenge with only a-zA-Z characters

Raku, 13 bytes

{[\R,] 1..$_}

Try it online!

Cumulative reverse with the range 1 to input.

Retina, 20 bytes

.+
*
L$w`_+
$.&
O$^`

Try it online! Explanation:

.+
*

Convert the input to a string of _s of that length.

L$w`_+
$.&

List the lengths of all the possible substrings. The way Retina enumerates substrings means that the lengths are in the exact reverse of the desired order.

O$^`

Reverse the output line-by-line.

PHP, 54 bytes

function($x){for(;$y<$x;$a[]=range(++$y,1));return$a;}

Try it online!

Or recursive:

PHP, 54 bytes

function f($x){return$x?f($x-1)+[$x=>range($x,1)]:[];}

Try it online!

Or with PHP-formatted printed output:

PHP, 38 bytes

for(;$x<$argn;print_r(range(++$x,1)));

Try it online!

Ruby, 34 30 bytes

->n,*a{(1..n).map{|x|a=[x]+a}}

Try it online!

Thanks Value Ink (as usual) for -4 bytes.

JavaScript (ES6),  50  49 bytes

Saved 1 byte thanks to @Shaggy

f=n=>n?[...f(n-1),(g=_=>n?[n,...g(--n)]:[])()]:[]

Try it online!

PHP, 54 bytes

for(;$i++<$argn;)$a[]=str_split($s=$i.$s);print_r($a);

Try it online!

R, 22 19 bytes

Map(`:`,1:scan(),1)

Try it online!

Map(f,...) applies f elementwise to each member of ..., recycling as needed, resulting in a list, so we just supply 1 as the to argument to : to get the reversed.

-3 bytes thanks to Vlo!

Factor, 45 bytes

: f ( n -- s ) [1,b] [ 1 [a,b] >array ] map ;

Try it online!

C (gcc), 54 bytes

i,t;f(n){for(i=0;n/++i;)for(t=i;t;)printf("%d ",t--);}

Try it online!

Charcoal, 9 bytes

IEN⮌E⊕ι⊕μ

Try it online! Link is to verbose version of code. Explanation:

  N         Input as a number
 E          Map over implicit 0-indexed range
      ι     Current index
     ⊕      Incremented
    E       Map over implicit 0-indexed range
        μ   Inner index
       ⊕    Incremented
   ⮌        Reversed
I           Cast to string for implicit print

There are other ways of getting the inner range such as InclusiveRange(1, Incremented(i)) and Range(1, Plus(2, i)) for the same byte count.

Japt, 4 bytes

õ!õ1

Try it here

shell + sed, 15 bytes

seq $1|sed G\;h

Try it online!

Outputs like so, 1\n\n2\n1\n\n3\n2\n1\n\n[...]

seq $1 creates a sequence from 1 to the first argument $1

|sed ... which is piped into a sed script

sed works on a line-by-line basis; it first reads the first line into the buffer, called the "pattern space", after which the program commands is run on it. At the end of the program's execution on the first line, the remaining pattern space is implicitly printed. Then sed reads the next line into the pattern space, replacing the previous contents, and runs the commands on it, repeating for all lines of input (unless a command specifies otherwise).

The pattern space is not saved between lines, but what is is the hold space. The hold space is another buffer, that starts empty, and can be modified by program commands. Its contents are carried on to the execution of the next line of input.

The G command appends a newline followed by the content of the hold space to that of the pattern space. Then the h command replaces the hold space with the content of the pattern space. This effectively reverses the lines of input encountered so far, writing them to the pattern space – implicitly printing at the end of processing the current line – and saving them to the hold space so that upon reading subsequent lines of input, the new reversed "list" can be constructed with G;h.

The ; is escaped in the program as \; because otherwise the shell interprets it as terminating a shell command.

APL (Dyalog Unicode), 5 4 bytesSBCS

Anonymous tacit prefix function.

,⍨\⍳

Try it online!

,⍨\ cumulative reverse-concatenation reduction of

 the iota

05AB1E, 3 bytes

LLí

Try it online!

Pure Bash (no external utilities), 29

eval eval echo \\{{1..$1}..1}

Try it online!

Python 3, 69 \$\cdots\$ 48 46 bytes

lambda n:[[*range(i+1,0,-1)]for i in range(n)]

Try it online!

GolfScript, 12 (13) bytes

,{)),(;-1%}%`
,{)),(;-1%}%` #Reversed iota of iota
,             #0 to n-1 iota
 {        }%  #For each element in the iota
 {))      }   #Increment by 2
 {  ,     }   #Iota
 {   (;   }   #Pop leading 0
 {     -1%}   #Reverse it
            ` #Pretty output, not needed if you use a better stack-interpreter

Try it online!

Below is my old solution, I gained inspiration after posting and improved it.

),(;{),(;-1%}%`

Comma is the function that builds an array 0 to n-1, "iota expand".

),(;{),(;-1%}%` #Take in a number, output reversed expanded iota
)               #Increment input by 1
 ,              #Iota expand
  (;            #Remove leading 0
    {       }%  #For every element, do the following
    {)      }   #Increment by 1
    { ,     }   #Iota expand
    {  (;   }   #Remove leading 0
    {    -1%}   #Reverse
              ` #Pretty output; technically not needed

Try it online!

Pyth, 5 bytes

_MSMS

Try it online!

Python 3, 46 bytes

lambda n:[[*range(i+1,0,-1)]for i in range(n)]

Try it online!

PowerShell, 19 bytes

1.."$args"|%{$_..1}

Try it online!

Generates the range from 1 to input $args, then constructs the reversed range for each of those numbers. Tack on a -join to better see how the arrays are created (because PowerShell inserts a newline between each element, it's tough to see the individual arrays).