# Questions tagged [hexagonal-grid]

For challenges involving data on a hexagonal grid. Use this tag also for triangular grids, the dual of the hexagonal grid (that is, the vertices of the hexagonal grid form the faces of the triangular grid and vice versa).

67 questions
Filter by
Sorted by
Tagged with
382 views

### Consolidate a 6-axis 2-dimensional Vector

Typically, when we want to represent a magnitude and direction in 2D space, we use a 2-axis vector. These axes are typically called X and Y: This isn't always convenient, however. The game BattleTech ...
3k views

### Totally random Catan number distributions

I like to play (The Settlers of) Catan on Board Game Arena with totally random number tokens. These tokens determine the production rate of the terrain tiles beneath: There are 18 number tokens, two ...
759 views

### A better Hexagony template

We once made a Hexagony template without actually knowing it. But after a bit of experience with Hexagony, it becomes apparent that it is not enough; sometimes the source code is too short for the ...
912 views

### Is this hexagon symmetric?

TLDR: This is the hexagonal version of Is this square symmetrical? Given a hexagonal grid, decide if it is symmetric. The shape of the grid is a regular hexagon. Each cell in the grid has two possible ...
396 views

### AoCG2021 Leftover: HexaGoL

This challenge is one of the two challenges which were planned for Advent of Code Golf 2021, but didn't fit into the 25-day schedule. Related to AoC2020 Day 24, Part 2. Given a binary configuration ...
599 views

### AoCG2021 Day 17: Langton's Hexa-Virus

The story continues from AoC2017 Day 22, Part 2. The damn virus that was infecting a grid computing cluster now has jumped to a hexagonal computing cluster! In this cluster, the computers are ...
1k views

### AoCG2021 Day 6: Taxicab in a triangular city

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2016 Day 1, Part 1. You're airdropped near Easter Bunny Headquarters in a city somewhere. "Near", ...
2k views

### Stack the rocks

This is a rock: * Rocks can be stacked. Apart from the bottom-most layer, each rock must rest on two other rocks, like this: ...
618 views

### Maximal hexagonal dot pattern

Challenge Imagine a hexagonal grid as shown below. Let's call such a grid has size $n$ if it has $n$ dots on one side. The following is one of size 3: ...
333 views

### Hexagonal section numbers

Introduction Let's draw some regular hexagons formed by hexagonal tiles, marking the vertices of the tiles with dots. Then we will count the number of dots. ...
585 views

### Sticky polyhexes

Background A polyhex of size $n$ is a contiguous shape made from joining $n$ unit regular hexagons side-by-side. As an example, the following image (from Wikipedia) contains all 7 distinct ...
959 views

### Cut a triangle into equal-sized parts!

Similar in spirit to Number of distinct tilings of an n X n square with free n-polyominoes and Partition a square grid into parts of equal area, this challenge will have you count ways of partitioning ...
532 views

### Number of tilings on a triangular board with triangular tiles

Background Consider the shape $T(n)$ consisting of a triangular array of $\frac{n(n+1)}{2}$ unit regular hexagons: John Conway proved that $n = 12k + 0,2,9,11$ if and only if $T(n)$ can be ...
331 views

### Counting shortest paths on a triangular grid

Background An Eisenstein integer is a complex number of the form $z = a + b\omega$ where $a, b$ are integers and $\omega$ is the third root of unity $\frac{1-\sqrt3i}{2}$. The Eisenstein ...
531 views

### What can you see on a hexagonal spiral?

This code-golf challenge will have you computing OEIS sequence A300154. Consider a spiral on an infinite hexagonal grid. a(n) is the number of cells in the part of the spiral from 1st to n-th cell ...
708 views

### Counting creatures on a hexagonal tiling

This challenge will have you count "creatures" in the tile game Palago. A creature is any closed shape that can be formed by Palago tiles of matching colour in a hexagonal grid. The game Palago ...
1k views

### A spiral sequence

Background OEIS sequence A272573 describes a spiral on a hexagonal grid as follows: Start a spiral of numbers on a hexagonal tiling, with the initial hexagon as a(1) = 1. a(n) is the smallest ...
3k views

### Triangular Lattice Points close to the Origin

Background A triangular grid is a grid formed by tiling the plane regularly with equilateral triangles of side length 1. The picture below is an example of a triangular grid. A triangular lattice ...
2k views

### Halting Problem for Simplified Hexagony

Introduction Decide whether a Hexagony program composed solely of the characters .)_|\/><@ will halt using least bytes. Challenge Hexagony is a language ...
1k views

### ASCII Hexagon Chain

Problem Draw a hexagon chain x long, each with side of y length Input x - the length of ...
1k views

The above image displays a hexagonal grid of hexagons. Each cell in the grid is assigned an index, starting from the center and spiraling counterclockwise around as shown. Note that the grid will ...
7k views

### ASCII Rubik's Cube

Inspired by this and the following chat: Your task is to output the following: _ _ _ /_/_/_/\ /_/_/_/\/\ /_/_/_/\/\/\ \_\_\_\/\/\/ \_\_\_\/\/ \_\_\_\/ ...
1k views

### THE Magic Hexagon

There are many magic squares, but there is just one non-trivial magic hexagon, as Dr. James Grime explained, which is the following: ...
2k views

### Hexagonal Triangles!

Your task: make a hexagonal triangle with side length n, where n is a positive whole number or 0. First, let me define a ...
741 views

### Working on my Knight moves

Hexagonal chess describes a family of chess variants played on a board where the cells are hexagons instead of the traditional squares. There are many such variants; in this challenge we'll be ...
785 views

### Embedded Hexagons!

Your task: given an integer n, generate an embedded hexagon pattern following the below rules, to the nth depth. An embedded hexagon has the basic shape of this: (...
2k views

### Triangular Manhattan Distance

The Manhattan distance on a regular grid is the number of orthogonal steps one needs to take to reach one cell from another. Orthogonal steps are those that go through the edges of the grid cells (as ...
9k views

### Could you make me a hexagon please?

Today, we're going to make an ASCII hexagon. You must write a program or function that takes a positive integer n, and outputs a hexagon grid of size n, made up of asterisks. For example, a hexagon of ...
3k views

### Snowman Bowling

(related/inspired by: Draw a bowling formation) A fun pastime in the winter months here is to perform snowman bowling, using a large ball (like a basketball) and tiny snowman figures. Let's recreate ...
527 views

### Make a ASCII Hexagon Ring Tiling

Using ASCII print a section of a hexagon ring tiling. Here's a small section: ...
494 views

### Hexagonal coordinates: Polar to Cartesian

Wikipedia says about Polar Coordinates: In mathematics, the polar coordinate system is a two-dimensional coordinate system in which each point on a plane is determined by a distance from a reference ...
464 views

### Hexagolf: Validagons

Challenge Given an ASCII art shape, you must find out whether the shape is a regular hexagon or not. Hexagons A regular hexagon is defined using two rules: It has six sides Each side has equal ...
443 views

### HexaGolf: Rotatagons

See also: Wordagons Challenge Given a hexagon and a number n as input, output the same hexagon rotated n times. Hexagon The ...
2k views

### HexaGolf: Wordagons

See also: Rotatagons Challenge Given a string as input, output its wordagon. Wordagons A wordagon is a way of representing a string in a hexagon. Now, let's create a wordagon from the string ...
2k views

### Hexplosive ASCII-art challenge

In the strategy game "Hexplode", players take turns placing tokens on a hexagonal board. Once the number of tokens equals the number of adjacent tiles, that tile hexplodes, and moves all of the tokes ...
1k views

### Highlight the Bounding Box, Part II: Hexagonal Grid

You're given a hexagonal grid of the characters . and #, like this: ...
867 views

### Gauss to Eisenstein

Given a Gaussian integer $a+bi$ where $a$,$b$ are integers and $i = \exp\left(\pi i/2\right)$ is the imaginary unit, return the closest (w.r.t to the Euclidean distance) Eisenstein integer \\$k+...
1k views

### HexaRegex: A Tribute to Martin Ender

Martin Ender recently hit 100K, and has come up with some pretty awesome languages. We're going to have a bit of fun with one of them, Hexagony (and a bit of regex for Retina) As a brief overview, ...
582 views

### Counting Eisenstein primes

Introduction Eisenstein integers are complex numbers of the form a+bω Where a,b are integers, and ...
3k views

### Draw and label an ASCII hexagonal grid

In my previous challenge, I drew the first diagram mostly by hand (with the help of vim's visual block mode). But surely there must be a better way... Given an input of two dimensions, a width and a ...
898 views

### Motion on a hexagonal grid

Given an input of a series of characters representing movements on a hexagonal grid, output the final coordinates of the "pointer." Our hexagons will be numbered like so (imagine a rectangular grid ...
2k views

### Triangular Ulam spiral

We've had a couple of challenges about the Ulam spiral. But that's not enough. In this challenge we will plot a triangular Ulam spiral (as opposed to the usual, square Ulam spiral). Here's a sketch ...
818 views

### Triangular Grids: Simply Connected Polyiamonds

While we're on a triangular grids kick, I'd like to point out that there is an equivalent to polyominoes on a triangular grid. They are called polyiamonds, and they are shapes formed by gluing ...
462 views

### Alignment on Triangular Grids

Hexagonal grids have been become a fairly popular twist for challenges about 2-dimensional data recently. However, it seems that the equally interesting triangular grids have been largely neglected so ...
4k views

### Unfolding the Hexagony source code

Introduction If you're not familiar with Hexagony, it's an esoteric language created by Martin Büttner. The thing is that this language accepts multiple forms for the program. The following programs ...
2k views

### Hexagonal maze time!

Time for another maze challenge, but not as you know it. The rules for this challenge are a little different than most maze challenges. The tile types are defined as follows: ...
867 views

### Packing Circles

Take a look at this image. Specifically, at how the holes on the ends are arranged. (Image source) Notice how the pipes in this image are packed in a hexagonal pattern. It is known that in 2D, a ...
768 views

### Program the Cup-Stacking Robot

I'm sure everyone has seen before that cups can be stacked into pyramids (and other shapes): A A A A A A A A A A A A A A A A A ...