Questions tagged [binary-matrix]

Indicates that the challenge involves the manipulation of binary matrices, matrices whose elements are all one of two possible values, typically 1 and 0, or True and False.

Filter by
Sorted by
Tagged with
19 votes
1 answer
715 views

Advent Challenge 1: Help Santa unlock his present vault!

Next >> Descriptive Keywords (for searching): Make Two Matrices Equivalent, Overlap, Array, Find Challenge Santa has had a history of elves stealing presents from his vault in the past, so this ...
hyper-neutrino's user avatar
  • 41.1k
48 votes
104 answers
6k views

Construct the Identity Matrix

The challenge is very simple. Given an integer input n, output the n x n identity matrix. The identity matrix is one that has <...
Seadrus's user avatar
  • 1,377
32 votes
18 answers
8k views

To find islands of 1 and 0 in matrix

Given a two dimensional matrix of 0 and 1s. Find the number of island for 1s and 0s where neighbours are only in the horizontal and vertical. ...
KB joy's user avatar
  • 329
54 votes
9 answers
5k views

Which tetromino is this?

Given an unsigned 16-bit integer N, your task is to determine whether its binary representation mapped inside a 4x4 matrix is matching a tetromino shape, and if so, which shape it is. Matrix Each ...
Arnauld's user avatar
  • 186k
49 votes
12 answers
3k views

Braille graphics

Cut a boolean matrix in 4x2 blocks and render them as Braille characters U+2800...U+28FF. ...
ngn's user avatar
  • 15.2k
14 votes
3 answers
2k views

Find highest scoring matrix without property X

This challenge is partly an algorithms challenge, partly an optimization challenge and partly simply a fastest code challenge. A cyclic matrix is fully specified by its first row ...
user avatar
21 votes
13 answers
1k views

The Binary Square Diagonal Sequence

The binary-square-diagonal-sequence is constructed as follows: Take the sequence of positive natural numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ... Convert each number to ...
Laikoni's user avatar
  • 25.8k
5 votes
5 answers
563 views

Print a specific value in the infinite Walsh matrix

The Walsh matrix is an interesting fractal matrix with the property that every single value in a Walsh matrix has a value of either -1 or 1. Additionally, the size of a Walsh matrix is always a power ...
Joe Z.'s user avatar
  • 34.6k
32 votes
6 answers
2k views

Slash the matrix

You are given a matrix of forward and back slashes, for instance: //\\ \//\ //\/ A slash cuts along the diagonal of its cell corner-to-corner, splitting it in ...
ngn's user avatar
  • 15.2k
22 votes
10 answers
2k views

How much is my dice matrix worth?

Input A non-empty binary matrix consisting of 3x3 sub-matrices put side by side. Task Your task is to identify valid dice patterns (as described below) among the 3x3 sub-matrices. Each valid ...
Arnauld's user avatar
  • 186k
19 votes
7 answers
1k views

Expand a matrix goo-ily

Input An \$m\$ by \$n\$ binary matrix, with \$m\$ and \$n\$ both at least 2. Think of the ones as gobs of melted cheese, which stretch as we expand the matrix horizontally and vertically. More ...
Jonah's user avatar
  • 32.4k
18 votes
11 answers
2k views

Count my Pluses

Your task is, to count how many pluses I have. What Pluses? The no plus: 0 Points - The naïve Plus: 1 Point + The double ...
math scat's user avatar
  • 7,849
17 votes
7 answers
2k views

But, Is It Art?

But Is It Art? is an esolang created by ais523, where one step is break the program into orthogonally connected "tiles": A BBBB A B B AA CC A CC Each ...
caird coinheringaahin g's user avatar
16 votes
18 answers
3k views

Calculate COVID spread

Because the coronavirus is still at large, I thought it would be fitting to have a epidemic-themed challenge. Challenge You are given a 2D array of people, where 1 ...
applemonkey496's user avatar
14 votes
5 answers
746 views

Print a specific value in this generated binary matrix

Suppose we define an infinite matrix M, on N^2 -> {0, 1} (where N starts from ...
Joe Z.'s user avatar
  • 34.6k
13 votes
8 answers
686 views

Minimal taxicab distance map

Challenge description In taxicab metric, a distance between two points is defined as: Consider a matrix with only zeros and ones: ...
shooqie's user avatar
  • 5,582
13 votes
16 answers
2k views

Trim that distracting background off!

Isn't it annoying when you're taking a picture, but the background detracts from the actual substance of the image? I'd say it is. I need to know how much I should crop so that I get rid of this ...
Mr. Xcoder's user avatar
  • 42.3k
12 votes
9 answers
1k views

AoCG2021 Day 13: Defrag in action!

Part of Advent of Code Golf 2021 event. See the linked meta post for details. The story continues from AoC2017 Day 14. To recap: The disk is a rectangular grid with \$r\$ rows and \$c\$ columns. Each ...
Bubbler's user avatar
  • 72.7k
11 votes
3 answers
546 views

Print a specific value in the Wythoff matrix modulo 2

The Wythoff matrix is an infinite matrix consisting of the Grundy numbers of each square on a chessboard in Wythoff's game. Each entry in this matrix is equal to the smallest nonnegative number that ...
Joe Z.'s user avatar
  • 34.6k
11 votes
2 answers
486 views

Make a Bit Continent

Let's imagine we have a matrix of bits (which contains at least one 1): ...
Esolanging Fruit's user avatar
10 votes
3 answers
1k views

Matrix property X revisited (or the Joy of X)

This challenge is partly an algorithms challenge, partly an optimization challenge and partly simply a fastest code challenge. A T matrix is fully specified by its first row ...
user avatar
10 votes
3 answers
2k views

Binary Puzzle Solver

Introduction Rules of the puzzle: The puzzle Binary (also known as Takuzu or Subiku) is very simple to understand, and has only a few rules: Since the name of the game is binary it's pretty obvious, ...
Kevin Cruijssen's user avatar
9 votes
9 answers
936 views

Neural Processing Lattice Checker

Consider the following 9 "row patterns", using 0s to represent empty cells and 1s to represent a full cell. Each pattern is associated with an integer \$n\$, such that \$0 \le n \le 8\$ (...
l4m2's user avatar
  • 19k
8 votes
6 answers
525 views

Group binary shapes together

Consider the following binary matrix: $$\begin{matrix} 1 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 1 \end{matrix}$$ The (1-indexed) co-ordinates of the \$1\$s here are \$(1,1), (1,3), (2,...
caird coinheringaahin g's user avatar