Linked Questions

39 votes
54 answers
4k views

Related but very different. A boustrophedon is a text where every other line of writing is flipped or reversed, with reversed letters. In this challenge, we will just reverse every other line, but ...
Adám's user avatar
  • 31.8k
27 votes
27 answers
3k views

Given a matrix, output a representation of the matrix where the top left element is on top, the anti-diagonal is the central row and the bottom right element is at the bottom. For example, consider ...
Fatalize's user avatar
  • 39.6k
34 votes
10 answers
3k views

Background In most reasonable programming languages, it's very easy to rotate the rows or columns of a 2D array. In this challenge, your task is to rotate the anti-diagonals instead. Recall that the ...
Zgarb's user avatar
  • 43.2k
22 votes
10 answers
2k views

There exists a bijection between the natural and rational numbers that works (approximately) like this: You create a 1-indexed 2-dimensional grid. In every field of this grid with position ...
leo848's user avatar
  • 637
16 votes
12 answers
2k views

A Shift matrix is a binary matrix with one superdiagonal or subdiagonal formed by only ones, everything else is a zero. A superdiagonal/subdiagonal is a diagonal parallel to the main diagonal, which ...
math scat's user avatar
  • 9,538
19 votes
8 answers
2k views

Inspired by this question Another way to unroll a 2D image into a 1D string is to use an Hilbert Curve. There are many version of this curve, depending on the number of iterations used while ...
WizardOfMenlo's user avatar
14 votes
9 answers
976 views

The positive rational numbers can be shown to be numerable with the following process: Zero has the ordinal 0 Arrange the other numbers in a grid so that row a, column b contains a/b Plot a diagonal ...
HAEM's user avatar
  • 671
24 votes
4 answers
1k views

As part of its compression algorithm, the JPEG standard unrolls a matrix into a vector along antidiagonals of alternating direction: Your task is to take the unrolled vector along with the matrix ...
Martin Ender's user avatar
16 votes
5 answers
570 views

I've been doing word searches recently, and I thought it would be so much easier if all of the words read left-to-right. But rewriting all the lines takes a lot of effort! So I'm enlisting code ...
Deusovi's user avatar
  • 1,540
4 votes
0 answers
96 views

A zigzag scan is a method of encoding 2D information in one dimension: Write a function or program that, given a one-dimensional string of printable ASCII characters, will reverse the zigzag scan to ...
Jordan's user avatar
  • 11.9k