Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
24 votes

Sticky polyhexes

Haskell, 320…236 230 bytes ...
Delfad0r's user avatar
  • 6,266
14 votes

Number of distinct tilings of an n X n square with free n-polyominoes

C, 7 terms The seventh term is 19846102. (The first six are 1, 1, 2, 22, 515, 56734, as stated in the question). ...
Grimmy's user avatar
  • 15.7k
13 votes

Counting polystrips

Python 3, 480 433 406 364 309 299 295 bytes Looked like a good point to start my PPCG career (or not?). ...
Bubbler's user avatar
  • 76.7k
13 votes

Tiling a staircase with staircases

JavaScript (ES10),  250 ... 228  227 bytes ...
Arnauld's user avatar
  • 193k
12 votes

Test a polyomino against Conway criterion

Python 3.8 (pre-release), 371 ... 338 336 bytes Takes as input a list of complex numbers, denoting the boundary coordinates in counterclockwise order. -9 bytes thanks to @ovs -2 bytes thanks to @...
dingledooper's user avatar
  • 22.7k
11 votes
Accepted

Impress Donald Knuth by counting polyominoes on the hyperbolic plane

GAP and its kbmag package, 711 682 658 bytes Note that the kbmag package consists not only of GAP code, it contains C programs that have to be compiled (see the ...
Christian Sievers's user avatar
11 votes
Accepted

Smallest region of the plane that contains all free n-ominoes

C# and SAT: 1, 2, 4, 6, 9, 12, 17, 20, 26, 31, 37, 43 If we limit the bounding box, there is a fairly obvious expression of the problem in terms of SAT: each translation of each orientation of each ...
Peter Taylor's user avatar
  • 43.1k
10 votes

Sticky polyhexes

C++, Not competing After spending so long on the golfing side of this challenge, I was curious to see what I could do from a fastest-code perspective. Here is my C++ attempt, which should be able to ...
Delfad0r's user avatar
  • 6,266
9 votes
Accepted

Number of distinct tilings of an n X n square with free n-polyominoes

An extension to @Grimy's code gets N=8 This just underlines that @Grimy deserves the bounty: I could prune the search tree by extending the code to check, after each finished polyomino, that the ...
Christian Sievers's user avatar
9 votes
Accepted

Gluing tetrahedra together

Rust, 11 (hopefully correct) terms ...
wastl's user avatar
  • 3,903
9 votes

Pretty print a grid of polyominoes

Charcoal, 147 129 80 78 76 75 71 65 bytes ≔⁺SψθWSF²⊞υ⁺⭆ι×⁴λψ⊞υ⭆⌊υψEυ⭆EιE⁴§§υ⁻κ÷ν²⁻μ∨⁼ν¹⁼ν²§θ﹪×⁷↨²Eλ⁼ν§λ⊕ξ⁹⁵ Try it online! Link is to verbose version of code. ...
Neil's user avatar
  • 171k
8 votes

L tromino tiling

JavaScript (ES6),  196 ... 185  182 bytes Takes input as a binary matrix. Returns a Boolean value. ...
Arnauld's user avatar
  • 193k
8 votes
Accepted

Compute the polyomino capacity of a rectangle

Python 2, 53 bytes lambda p,q,n:p/n*q+q/n*(p%n)-min(0,n-p%n-q%n)*(p>n<q) Adapts the formula given in this paper, which is: ...
xnor's user avatar
  • 145k
8 votes

Smallest region of the plane that contains all free n-ominoes

C#, score: 1, 2, 4, 6, 9, 12, 17, 20, 26, 31, 38, 44 ...
Peter Taylor's user avatar
  • 43.1k
8 votes

Can this polyomino tile the toroidal grid?

Python 2, 300 265 163 bytes -35 bytes after suggestions from @xnor, @ovs, and largely @user202729 (removing evenly divisible check allowed for a one-liner + lambda) -102 bytes following encouragement +...
fireflame241's user avatar
  • 16.3k
8 votes

Is this an L-shape?

05AB1E, 31 30 17 bytes ø‚O0δÚDWδåsεÔg<}Q Try it online or verify all test cases. Explanation: ...
Kevin Cruijssen's user avatar
8 votes

Sticky polyhexes

Ruby, 290 270 bytes ...
Level River St's user avatar
7 votes

Rotation invariant fingerprinting

Python 2, 48 bytes f=lambda l,z=5:z and max(l,f(zip(*l)[::-1],z-1)) Try it online! Takes the largest of the four rotations in terms of list comparison. Based on ...
xnor's user avatar
  • 145k
7 votes
Accepted

Counting generalized polyominoes

Haskell Now that not only the comments document that Peter Taylor was the first one to give enough terms to search on OEIS, I can give my results. ...
Christian Sievers's user avatar
7 votes

Is this an L-shape?

J, 51 48 79 bytes (1-'10+1'rxin'012'{~2,@,.],|:)*1&#.(,~&{:-:,&(0{#/.~)+0{,)&(|.^:({.>{:)@-.&0)+/ Try it online! +31 thanks to Bubbler for ...
Jonah's user avatar
  • 33.5k
7 votes

Pretty print a grid of polyominoes

JavaScript (ES6),  164 154  143 bytes Expects (a)('╬╩╠╚╣╝║╦═╔ ╗'), where a is a list of strings. ...
Arnauld's user avatar
  • 193k
7 votes

Pretty print a grid of polyominoes

PowerShell, 282 243 219 bytes Thanks @Arnauld for the idea that the values can be directly mapped to the output characters! I've made a code that finds such an expression by brute force. The ...
mazzy's user avatar
  • 7,085
6 votes

Drawing convex polyiamonds

Ruby, 202 bytes ...
Level River St's user avatar
6 votes

Counting polystrips

APL (Dyalog Unicode), 70 65 bytes +/{∧/∊2≤|(⊢-¯3↓¨,\)+\0 1,×\0j1*⍵}¨∪{(⊃∘⍋⊃⊢)(⊢,⌽¨)⍵(-⍵)}¨2-,⍳2↓⎕⍴3 Try it online! Full program version of the code below, ...
Bubbler's user avatar
  • 76.7k
6 votes

Counting generalized polyominoes

2, 2, 4, 10, 28, 79, 235, 720, 2254, 7146, 22927, 74137, 241461, 790838, 2603210, 8604861, 28549166, 95027832 I'm going to put a stake in the ground before Christian Sievers posts an answer for n=18. ...
Peter Taylor's user avatar
  • 43.1k
6 votes

Can this polyomino tile the toroidal grid?

JavaScript (ES7), 233 bytes Takes input as (w)(h)(p), where \$p\$ is a binary matrix describing the polyomino. Returns \$0\$ or \$1\$. Similar to my original answer,...
Arnauld's user avatar
  • 193k
6 votes

Tiling a staircase with staircases

Charcoal, 91 88 87 83 81 78 bytes ≔⊕Nθ⊞υEθ⁻X²θX²ιF⊖θFθFE²Eθ×÷⊖X²θX²⁺ινX²⁺κ∧λνF⟦λ⮌λ⟧FθFυF¬⊙ξ&π§μ⁻ρν⊞υEξ|ρ§μ⁻ςνILυ Try it online! Link is to verbose version of code. ...
Neil's user avatar
  • 171k
6 votes

Is this an L-shape?

JavaScript (V8), 500 bytes Lots of golfing possible. ...
Rydwolf Programs's user avatar
6 votes

Is this an L-shape?

APL (Dyalog Extended), 48 bytes (SBCS) Anonymous tacit prefix function. Takes Boolean (0/1) matrix with 0s indicating the shape. Requires 0-based indexing. ...
Adám's user avatar
  • 30.3k

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