57 votes

N-dimensional N^N array filled with N

Python, 32 bytes lambda n:eval('['*n+'n'+']*n'*n) Try it online! Makes a string like "[[[n]*n]*n]*n" with ...
xnor's user avatar
  • 144k
50 votes

No strings (or numbers) attached

Funciton, 1222 bytes Apart from numeric literals, there are two ways I can produce a value (any value at all) in Funciton: stdin and lambda expressions. Stdin is a single box while a full lambda ...
Timwi's user avatar
  • 12.9k
34 votes

N-dimensional N^N array filled with N

J, 4 bytes $~#~ Try it online! Explanation ...
miles's user avatar
  • 16.8k
26 votes

No strings (or numbers) attached

JavaScript, 144 141 140 138 132 125 123 bytes With help from @edc65, @Sjoerd Job Postmus, @DocMax, @usandfriends, @Charlie Wynn and @Mwr247! ...
user81655's user avatar
  • 11.2k
22 votes

Fill the rows, columns, and diagonals of an NxN grid with 1 through N

Funciton, non-competitive UPDATE! Massive performance improvement! n = 7 now completes in under 10 minutes! See explanation at bottom! This was good fun to write. This is a brute-force solver for ...
Timwi's user avatar
  • 12.9k
21 votes
Accepted

No strings (or numbers) attached

Hexagony, 13 bytes 1 2 3 4 5 6 7 8 9 10 42 Try it online! In Hexagony, 0 through 9 are functions that multiply the current ...
Leaky Nun's user avatar
  • 49.5k
16 votes

No strings (or numbers) attached

Mouse-2002, 27 26 17 14 bytes The first snippets push 0-10, and ZR+ pushes 25 then 17 and <...
cat's user avatar
  • 5,839
16 votes

N-dimensional identity "matrix"

Octave, 29 bytes @(n)accumarray((x=1:n)'+!x,1) Try it online!
rahnema1's user avatar
  • 5,655
16 votes

Help Stack Exchange transpose tables

Python 3.8 (pre-release), 218 bytes ...
Anakhand's user avatar
  • 301
15 votes

No strings (or numbers) attached

CJam, 27 24 bytes ...
Dennis's user avatar
  • 209k
15 votes

All the k-mers/n-grams

Jelly, 1 byte Jelly has a single byte dyadic atom for this very operation Try it online! (the footer splits the resulting list with newlines, to avoid a ...
Jonathan Allan's user avatar
13 votes

N-dimensional N^N array filled with N

APL (Dyalog APL), 4 bytes ⍴⍨⍴⊢ Try it online!
Dennis's user avatar
  • 209k
13 votes

N-dimensional N^N array filled with N

Mathematica, 22 20 bytes (t=Table)@@t[#,#+1]& (* or *) Table@@Table[#,#+1]&
JungHwan Min's user avatar
  • 13.8k
12 votes

No strings (or numbers) attached

Perl 5, 86 75 71 66 bytes All ^Fs are literal control characters (0x06 in ASCII), and hence a single byte. ...
Doorknob's user avatar
  • 71.4k
12 votes

No strings (or numbers) attached

Brainfuck, 70 bytes + ++ +++ ++++ +++++ ++++++ +++++++ ++++++++ +++++++++ ++++++++++ --[>+<++++++]>- Each line must be run individually. The first 10 ...
p1xel's user avatar
  • 241
12 votes

No strings (or numbers) attached

Darkness, 339 303 bytes This is where Darkness really shines. Get it? :~)! Without printing (replaced the space with \s in the first line since it won't show ...
sweerpotato's user avatar
  • 2,497
10 votes

No strings (or numbers) attached

Prolog, 113 99 bytes Snippets: ...
Emigna's user avatar
  • 52.9k
10 votes

No strings (or numbers) attached

MATL, 30 bytes O l H I K Kl+ HI* KYq HK* IH^ K:s IH^:sI- H, I, and ...
David's user avatar
  • 1,316
10 votes

N-dimensional N^N array filled with N

JavaScript (ES6),  44  40 bytes f=(n,k=i=n)=>i--?f(n,Array(n).fill(k)):k Demo ...
Arnauld's user avatar
  • 186k
10 votes

N-dimensional N^N array filled with N

Octave, 35 33 25 23 20 bytes @(N)ones(N+!(1:N))*N Try it online! @(N)ones(N*ones(1,N))*N @(N)repmat(N,N*ones(1,N)) Thanks to @...
rahnema1's user avatar
  • 5,655
10 votes

N-dimensional N^N array filled with N

R, 26 This is the obvious answer but perhaps there is something cleverer? n=scan();array(n,rep(n,n))
Flounderer's user avatar
10 votes

Typo resistant pin codes

Python 2, 1000 unique pin codes, 44 bytes i=0;exec'print i+int(`i`,11)%10;i+=10;'*1000 Try it online! I suspect 1000 pin codes is optimal. You can check the ...
Sisyphus's user avatar
  • 14.4k
9 votes

No strings (or numbers) attached

C#, no usings, 234 bytes ...
Timwi's user avatar
  • 12.9k
9 votes

No strings (or numbers) attached

PHP, 157 145 91 bytes First time posting on Code Golf, figured I'd give it a shot. I'll get better eventually :P If you see any obvious (to you) spots where I could save characters, let me know. ...
orp's user avatar
  • 261
9 votes

No strings (or numbers) attached

PowerShell, 147 bytes These use + to implicitly cast things to integers. The later numbers use Enums from the .Net Framework unerpinnings of PowerShell which ...
TessellatingHeckler's user avatar
9 votes

No strings (or numbers) attached

Python 2, 191 159 158 157 156 149 146 bytes My first submission ever, I hope I got everything right ! Based on the time I spent on this, I guess there's surely a better one for a few of them. ...
Joachim Jablon's user avatar
9 votes

N-dimensional N^N array filled with N

05AB1E (legacy), 6 5 bytes -1 thanks to Kevin Cruijssen F¹.D) Try it online! ...
Riley's user avatar
  • 11.7k
9 votes

N-dimensional N^N array filled with N

Haskell, 52 bytes f n=iterate(filter(>'"').show.(<$[1..n]))(show n)!!n Try it online! Inspired by @nimi's answer, but using more predefined functions. ...
Ørjan Johansen's user avatar
9 votes

Borderless table

JavaScript (ES8),  186 180  179 bytes Saved 1 byte thanks to @Shaggy ...
Arnauld's user avatar
  • 186k

Only top scored, non community-wiki answers of a minimum length are eligible