Linked Questions
16 questions linked to/from Wind me a number snake!
41
votes
51
answers
7k
views
Cops: Make a regex - Make a snake
This is the cop's thread. The robber's thread is here.
Write a code that takes an input n and creates a n-by-n "snake matrix".
A snake matrix is a matrix that ...
29
votes
17
answers
4k
views
s-n-a-k-e-a-r-o-u-n-d--->
This ascii-art challenge is about walking around a string like a snake.
s-n-a-k
.---. e
d <-' a
n-u-o-r
You will be given a string \$ S \$ of length \$ l \$ and ...
28
votes
15
answers
8k
views
Number Spiral Problem
A number spiral is an infinite grid whose upper-left square has number 1. Here are the first five layers of the spiral:
Your task is to find out the number in row y and column x.
Example:
...
29
votes
11
answers
3k
views
Asterisk spiral
Given the spiral of size S and the step N, output the "square" S*S spiral having ...
22
votes
10
answers
2k
views
Roll the Alphabet into a Spiral
Write a program or function that, when given n, will print a spiral n characters long made up of the Latin alphabet ...
33
votes
8
answers
1k
views
Can square tree rings be generated from primes?
Apparently yes! In three easy steps.
Step 1
Let f(n) denote the prime-counting function (number of primes less than or equal to n).
Define the integer sequence s(n) as follows. For each positive ...
24
votes
9
answers
1k
views
Spiral neighbourhoods
If we take the natural numbers and roll them up counter clock-wise into a spiral we end up with the following infinite spiral:
...
31
votes
7
answers
2k
views
pssssssssssssst
Introduction
This is one is pretty straightforward. We will be drawing a snake in ascii. This was inspired by that old snake game where you have to collect the fruit and you continuously grow.
...
6
votes
15
answers
1k
views
Alphabet Spiral
You are to write a program or function that outputs this exact text:
OPQRSTU
NQPONMV
MREDCLW
LSFABKX
KTGHIJY
JUVWXYZA
IHGFEDCB
May also be lowercase and trailing ...
15
votes
9
answers
689
views
Roll the carpet
This question is inspired by Kevin Cruijssen's question.
Now that the carpet is laid out, we want to roll it. Your task is to write a program that takes a string and returns a spiral made from this ...
11
votes
7
answers
810
views
Determine the position of a non-negative number in the infinite spiral
Definition
The infinite spiral used in this question has 0 on the position (0,0), and continues like this:
...
13
votes
11
answers
802
views
Square-unspiral the string!
Given a string, first square it as follows:
First, write the string.
abcde
Next, write the string rotated one left.
...
6
votes
5
answers
474
views
Return Spiral Indexes!
Spirals are cool , so are numbers, and number spirals are even cooler. But what if I want a specific number, in a specific place using xy coordinates...
Challenge
Using an infinite spiral moving ...
8
votes
4
answers
219
views
Flattened Spiral Permutation Index
Context
Consider square matrices with n columns and rows containing the first n^2 (i.e. n ...
4
votes
4
answers
148
views
Given a grid, starting at the center and spiraling out, and an Position what is the ID?
Related:
Determine the position of a non-negative number in the infinite spiral
Wind me a number snake!
Challenge:
Given a grid, with an ID starting at the center and spiraling out, what is the ID ...