Skip to main content
13 votes

9-16-25 2D Matrix

Picat ...
Bubbler's user avatar
  • 78.2k
11 votes

The smallest area of a convex grid polygon

Python, n=44 in under 2 minutes This can go up to 44-gons in under 2 minutes, using pypy on my laptop. CPython is slightly slower (2'45''). The approach is rigorous. It uses the dynamic programming ...
Günter Rote's user avatar
8 votes
Accepted

How many cacti can I plant here?

Picat, 216 bytes ...
Bubbler's user avatar
  • 78.2k
6 votes

Can I Clear The Grid?

JavaScript (ES11), 185 bytes -3 thanks to l4m2 Expects a matrix of digits (with 0 for empty) and returns a Boolean value. ...
Arnauld's user avatar
  • 195k
6 votes

9-16-25 2D Matrix

Brachylog, 43 bytes {hlL;Mṁ₍+ᵐ~h?∧M\+ᵐ~t?∧Mc≠{>0∧.^₂≥?∧}ᵛL∧M≜}ᵐ Try it online! Takes about 5 seconds for all 3 cases on TIO. Explanation Since Brachylog uses ...
Fatalize's user avatar
  • 39.1k
5 votes

Is it a Valid Crossword Grid?

Jelly, 40 35 33 bytes -5 thanks to Nick Kennedy! ;ZµŒg§’:2;§Ȧ ŒṪḢạ§ỊẸʋƇ@ƬiƊȧÇȧU⁼ṚƊ A monadic Link that accepts a list of lists of ...
Jonathan Allan's user avatar
5 votes

How many cacti can I plant here?

JavaScript (Node.js), 150 147 bytes ...
l4m2's user avatar
  • 26k
5 votes

How many cacti can I plant here?

Python3, 566 bytes Long, but not naive brute-force. ...
Ajax1234's user avatar
  • 7,451
5 votes

How many cacti can I plant here?

Jelly, 34 bytes ạSỊɗƇⱮ` ŒJÇðZÆṁWfœịÐṀð€ẎŒPṚÇẈPƊÞḢL A monadic Link that accepts a list of lists of positive integers, the landscape, and yields a non-negative ...
Jonathan Allan's user avatar
5 votes
Accepted

9-16-25 2D Matrix

Java (Simple) backtracking approach with random candidates: ...
tgrothe's user avatar
  • 206
5 votes

9-16-25 2D Matrix

Python To run the code, install the z3-solver package. It can usually solve all three cases in ~1s. ...
dingledooper's user avatar
  • 22.8k
4 votes

Can I Clear The Grid?

Python3, 368 bytes ...
Ajax1234's user avatar
  • 7,451
4 votes

Can I Clear The Grid?

Charcoal, 109 bytes WS⊞υ⁻ι ≔⟦υ⟧υFυFLιF⌕A§ικ.«ιJλκ≔E⁴KDL⁺ι⌊ι✳⊗μθ≔EθΦ⁻⪫μω.¬πηFΦ⁴∧§ημ⊖№η§ημ§≔§θμ⌕§θμ§ημ.≔⪪⪫KAωL⌊ιεF¬⁼ει⊞υε⎚»⊙υ⬤ι¬⁻λ. Try it online! Link is to verbose ...
Neil's user avatar
  • 174k
4 votes

Can I Clear The Grid?

Python 3, 260 bytes ...
CursorCoercer's user avatar
4 votes

3 Dimensional Minesweeper

JavaScript (ES6), 147 bytes -1 thanks to emanresu A Expects (dim0, dim1, dim2, mines), where mines is a list of comma-separated strings. Output format: integers ...
Arnauld's user avatar
  • 195k
4 votes

3 Dimensional Minesweeper

JavaScript (Node.js), 117 bytes ...
tsh's user avatar
  • 35k
3 votes

A cube of text឵

Vyxal, 13 bytes L?∞Ṫ»∨¹0²H»ø∧ Try it Online! Indirectly -1 byte thanks to Kevin Cruijssen, I forgot how canvas operator overloading works. ...
emanresu A's user avatar
  • 41.6k
3 votes

Highlight the Bounding Box, Part II: Hexagonal Grid

R, 561 bytes ...
Patric's user avatar
  • 289
3 votes

Highlight the Bounding Box, Part I: Cartesian Grid

JavaScript (Node.js), 139 bytes ...
l4m2's user avatar
  • 26k
3 votes

Can this pattern be made with dominoes?

Picat, 163 bytes ...
Bubbler's user avatar
  • 78.2k
3 votes

Create Bernard from Desmos

Uiua, 19 bytes ⍥(⊂⊃∘=.⍉⊂⊃-⍉.⇌):¤¤1 Try it online! How it works ...
ronwnor's user avatar
  • 31
3 votes

The smallest area of a convex grid polygon

Rust, n=44 in ~7 seconds This is merely an abridged port of Günter Rote's solution, no original contribution. ...
colt_browning's user avatar
3 votes

Is it a Valid Crossword Grid?

Python3, 562 bytes: ...
Ajax1234's user avatar
  • 7,451
3 votes

Is it a Valid Crossword Grid?

Retina 0.8.2, 186 183 bytes ...
Neil's user avatar
  • 174k
3 votes

Is it a Valid Crossword Grid?

JavaScript (ES11), 176 bytes Saved 1 byte thanks to @tsh Expects a binary matrix, with 1 for white cells and 0 for black cells. ...
Arnauld's user avatar
  • 195k
3 votes

3 Dimensional Minesweeper

Charcoal, 34 bytes EθEη⭆Eζ⟦ιλν⟧⎇№εν*§⁺0βLΦε⬤ν‹↔⁻ς§πσ² Try it online! Link is to verbose version of code. Takes the dimensions as three arguments followed by the ...
Neil's user avatar
  • 174k
3 votes

3 Dimensional Minesweeper

MATLAB, 99 bytes function M(s,m) b=zeros(s);for n=m;b(n(1),n(2),n(3))=1;end;c=convn(b,ones(3,3,3),'same');c(b==1)=-1 Uses convn to do the convolution. Mines are ...
rst's user avatar
  • 41
3 votes

9-16-25 2D Matrix

Nekomata + -1, 21 bytes ᵃ#*R↕v#Š:ᵐ∑ᵈv=¿:∑ᵈ§=¿ Attempt This Online! I just wanted to see how fast my golfing language can go. ...
alephalpha's user avatar
  • 49.4k
2 votes

Very Simple Grid Marks

K (ngn/k), 10 bytes {y#|x$"X"} Try it online! Takes input as two arguments; N as the first/left arg, and ...
coltim's user avatar
  • 6,063
2 votes

Highlight the Bounding Box, Part I: Cartesian Grid

Scratch, 550 bytes (Hardly a golf, rather an exercise in Scratch to operate on strings and matrices) Instructions: Create a sprite with two costumes. Replace Costume 1 with a dot ...
Patric's user avatar
  • 289

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