Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

# 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).

64 questions
Filter by
Sorted by
Tagged with
824 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 ...
376 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 ...
574 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: ...
574 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: ...
322 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. ...
530 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 ...
883 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 ...
500 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 ...
315 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 ...
512 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 ...
666 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 ...
6k 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: ...
1k 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 ...
721 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 ...
758 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 ...
8k 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 ...
2k 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 ...
486 views

### Make a ASCII Hexagon Ring Tiling

Using ASCII print a section of a hexagon ring tiling. Here's a small section: ...
458 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 ...
436 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 ...
428 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 ...
1k 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 ...
966 views

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

You're given a hexagonal grid of the characters . and #, like this: ...
841 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, ...
539 views

### Counting Eisenstein primes

Introduction Eisenstein integers are complex numbers of the form a+bω Where a,b are integers, and ...
2k 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 ...
841 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 ...
742 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 ...
430 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: ...
830 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 ...
735 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 ...
4k views

### ASCII connected hexagons

Overview Given a number of hexagons, arrange them into a connected shape within the confines of a 50 by 50 ASCII art image. The shape you choose can be arbitrary - whatever you find most amenable to ...
565 views

### Rotate a diamond tiling

Any regular hexagon can be tiled with diamonds, for instance like so (stolen from this question): ...
876 views

### Play a Perfect Game of 4x4 Hex

Background Hex is a two-player abstract strategy game played on a K×K rhombus of hexagonal tiles. Two opposite sides of the rhombus are colored white, and ...