26
votes
Concentric rings on a snub square tiling
Ruby, 26 bytes
->n{~-n*12-496/4**n%4+1/n}
Try it online!
Revised version adding 1/n and subtracting ...
16
votes
Is it a checkered tiling?
JavaScript, 106 101 bytes
s=>[...s,'!',s].reverse().join``.match(`(.)((?!\\1).)[^!]{${s.indexOf`
`-1}}((?!\\1|\\2).)(\\2|\\3)`)
Try it online!
(Returns ...
15
votes
Piet (Mondrian)'s Puzzle
Piet, 9625
(It finally works!)
The people demanded it, so here it is. This is an extremely naive solution (essentially the same as the loose upper bounds on the OEIS page): it divides each square ...
15
votes
14
votes
Triangular domino tiling of an almost regular hexagon
APL (Dyalog Classic), 14 bytes
×/1+1÷1+∘,1⊥¨⍳
Try it online!
Uses 0 indexing with ⎕IO←0.
Explanation:
...
13
votes
Is it a checkered tiling?
Python 3, 100 99 88 bytes
lambda a:2in[len({i,l}^{k,j})for x,y in zip(a,a[1:])for i,j,k,l in zip(x,x[1:],y,y[1:])]
Try it online!
Return ...
12
votes
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 @...
12
votes
11
votes
Draw the GKMS aperiodic tile
JavaScript (ES6), 150 bytes
-10 thanks to @Neil
Generates a SVG.
...
10
votes
Accepted
Seamless conversion from square to hexagon
Matlab, 223 215 209 184 163 bytes
The rescaling is quite straight forward. For cropping the corners I overlay a coordinate system over the pixels, and make a mask via four linear inequalities, which ...
10
votes
9
votes
Concentric rings on a snub square tiling
JavaScript (ES6), 23 bytes
Based on Level River St's answer.
n=>[1,5,13,7][--n]^n*12
Try it online!
How?
We compute \$(n-1)\times12\$ and adjust the first 4 ...
9
votes
Concentric rings on a snub square tiling
05AB1E, 9 bytes
<©12*3®cα
Try it online! or try a test suite.
...
9
votes
Is this a robbery?
Jelly, 10 8 bytes
ḟ⁶OIA7fỌ
A full program which prints an empty string (falsey) if all is well or a bell character if not (a bell character is also truthy).
...
9
votes
Is this a robbery?
Brachylog, 17 12 10 bytes
-5 bytes by not distinguishing between Employees and Jewels
-2 bytes using addition, not multiplication, so I get 7 for \a for free
Empty tiles are ...
9
votes
8
votes
Finite tilings in one dimension
JavaScript (ES6), 74 73 70 bytes
Takes input as an array of 32-bit integers. Returns a boolean.
...
8
votes
Triangular domino tiling of an almost regular hexagon
Perl 6, 38 30 bytes
{[*] map 1+1/(*+1),[X+] ^<<@_}
Try it online!
Based on the formula given in the question
Explanation:
...
8
votes
Accepted
8
votes
Number of tilings on a triangular board with triangular tiles
JavaScript (Node.js), N = 22 25 32 in ~2 seconds
A recursive search using bit masks and a cache to keep track of patterns whose result is already known.
It doesn't make much sense to try go further ...
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 +...
8
votes
Maximal saturated domino covering of a rectangle
Sagemath, 60 bytes
lambda m,n:m*n-len(graphs.GridGraph([m,n]).dominating_set())
Try it online!
From Saturated Domino Coverings by Buchanan et al:
Corollary 6.3: ...
8
votes
Is it a checkered tiling?
Ruby, 108 bytes
->a{w,i,j,q=0;a.map{|x|w,i=(j=x.zip(j||x).map{|y,c|[y==i ?w:w^=1,i=y,q||=((c[0]==w)^(c[1]==i))&&j]})[0]};!q}
Try it online!
7
votes
Integers, Assemble!
Python 2, 210 200 bytes
Edit: Works now!
Fills from top to bottom, left to right, starting with the largest numbers. Then, transpose and do it again. Then transpose and print. I had to pad with spaces ...
7
votes
Concentric rings on a snub square tiling
Python, 31 bytes
lambda n:n*12-11-(n>4or 5%-n%5)
Try it online!
7
votes
Number of tilings on a triangular board with triangular tiles
Rust, \$n \le 44\$ in 42 seconds
Build with rustc -O. Uses about 800 MiB of memory for \$n = 38\$, and \$39 \le n \le 44\$ are trivial. \$n = 45\$ will almost ...
6
votes
Simplest Tiling of the Floor
APL(Dyalog Unicode), 53 37 36 bytes SBCS
{⌊/×/¨⍸(~6∊' a'∧/⍤⍳⍵⊢⌸⍥,⍨|)⍤0 2⍨⍳⍴⍵}
Try it on APLgolf!
Instead of partitioning, this one groups the characters in the ...
6
votes
Generate valid Fibonacci tilings
APL (Dyalog Unicode), 43 bytes
(1+∘÷⍣=1){'LS'[∪2</⍺|(⍺×(⍳÷⊢)2*⍵)∘.+⍳⍵]}1∘+
Try it online!
This uses the alternative formulation (actually the first one) shown ...
6
votes
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tiling × 50code-golf × 44
ascii-art × 13
combinatorics × 13
grid × 13
decision-problem × 7
geometry × 7
graphical-output × 7
hexagonal-grid × 5
dominoes × 5
polyomino × 4
sequence × 3
kolmogorov-complexity × 3
fastest-code × 3
array × 3
string × 2
math × 2
code-challenge × 2
matrix × 2
restricted-time × 2
set-partitions × 2
number × 1
popularity-contest × 1
random × 1
game × 1