Tag Info

Hot answers tagged binary-matrix

Slash the matrix

MATL, 21 bytes 3XytPJ*-X*Xj~4&1ZIunq The input is a matrix with 1 for \ and ...
• 105k

Weakened Binary Walls

MATL, 4 bytes BSXB Try it at MATL Online Explanation ...
• 11.1k

Which tetromino is this?

Python 3, 124 bytes ...
• 68.8k

Is there a single straight line in the matrix?

Python 2, 49 bytes Takes as input a 2D binary matrix $a$, and its size $n$. lambda a,n:sorted(map(sum,a+zip(*a)))[-2:]==[1,n] Try it online! There may be ...
• 22.7k

Is it bipartite?

Wolfram Language (Mathematica), 26 25 bytes Tr[#//.x_:>#.#.Clip@x]<1& Try it online! How it works Given an adjacency matrix A, we find the fixed ...
• 5,245

• 12.5k

Decode Faux Braille

JavaScript (ES6),  148 146 143  142 bytes Saved 1 byte thanks to @ngn ...
• 193k

The Binary Square Diagonal Sequence

Husk, 15 14 bytes zȯḋm←CtNCİ□ṁḋN Try it online! Continually prints the results as an infinite list. Explanation I wonder whether there's a better way to get ...
• 197k
Accepted

Where is that snake going?

Wolfram Language (Mathematica), 16+83=99 bytes Library import statement (16 bytes): <<Combinatorica` Actual function body (83 bytes): ...
• 17.3k

Trim that distracting background off!

MATL, 5 bytes JYaZy Try it online! Or verify all test cases. Explanation ...
• 105k

Jelly, 10 bytes ŒJạ€ŒṪ§Ṃ€Ṁ Try it online! -2 bytes thanks to Sisyphus Calculate the Manhattan differences from all 0s to all 1s, and the answer is the maximum of ...
• 42.4k

Wolfram Language (Mathematica), 90 78 bytes f=Length@FixedPointList[ListConvolve[CrossMatrix@1,#,{2,2},0,Times,Max]&,#]-2& Try it online! -12 bytes, ...
• 261
Accepted

Stencil , 2 bytes ×v Try it online! tallies the number of necessary steps (including ...
• 30.4k

Is there a single straight line in the matrix?

Ruby, 47 bytes ->m,n{m.uniq[1]?m-[[0]*n]==[[1]*n]:m[0].sum==1} Try it online! Explain please: Split the two cases: If m has at least 2 different rows, remove ...
• 22.1k

Scribble Pad for Nerds

Charcoal, 9 bytes ＦＡ✳ι##‖↘# Try it online! Link is to verbose version of code. Explanation: ＦＡ Loop over the directions. ...
• 172k

Braille graphics

Jelly,  31  30 bytes sz0Z ç€2ZF€ç€8Zœ?@€€-36Ḅ+⁽\$ṁỌY Try it online! How? ...
• 107k

Change the rules of Life

MATL, 24 23 bytes xx:"tt3Y6Z+1Gm<8M2Gmb*+ Inputs are: Array with birth rule Array with survival rule Number of generations Matrix with initial cell ...
• 105k

Mutually Attacking Queens

JavaScript (ES7), 86 bytes Takes input as an array of 64 integers with 254 for a queen and 0 for an empty square. ...
• 193k