Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

20
votes
2answers
394 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 ...
22
votes
0answers
485 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 ...
13
votes
6answers
972 views

ASCII Hexagon Chain

Problem Draw a hexagon chain x long, each with side of y length Input x - the length of ...
28
votes
6answers
668 views

Hexagonal adjacency

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 ...
12
votes
22answers
5k views

ASCII Rubik's Cube

Inspired by this and the following chat: Your task is to output the following: _ _ _ /_/_/_/\ /_/_/_/\/\ /_/_/_/\/\/\ \_\_\_\/\/\/ \_\_\_\/\/ \_\_\_\/ ...
16
votes
10answers
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: ...
20
votes
7answers
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 ...
16
votes
6answers
627 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 ...
18
votes
4answers
615 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: (...
25
votes
11answers
1k 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 ...
52
votes
57answers
6k 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 ...
29
votes
10answers
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 ...
11
votes
4answers
401 views

Make a ASCII Hexagon Ring Tiling

Using ASCII print a section of a hexagon ring tiling. Here's a small section: ...
12
votes
2answers
235 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 ...
13
votes
4answers
346 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 ...
14
votes
4answers
347 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 ...
25
votes
9answers
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 ...
19
votes
9answers
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 ...
24
votes
8answers
852 views

Highlight the Bounding Box, Part II: Hexagonal Grid

You're given a hexagonal grid of the characters . and #, like this: ...
11
votes
2answers
251 views

Gauss to Eisenstein

Given a Gaussian integer A+B*i where A,B are integers and i = exp(2*pi*i/4) is the imaginary ...
37
votes
3answers
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, ...
7
votes
3answers
402 views

Counting Eisenstein primes

Introduction Eisenstein integers are complex numbers of the form a+bω Where a,b are integers, and ...
10
votes
1answer
962 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 ...
13
votes
5answers
585 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 ...
22
votes
6answers
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 ...
9
votes
2answers
427 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 ...
18
votes
2answers
238 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 ...
52
votes
9answers
3k 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 ...
27
votes
6answers
1k views

Hexagonal maze time!

This challenge has an open 500 rep bounty by lirtosiast for a Hexagony solution Time for another maze challenge, but not as you know it. The rules for this challenge are a little different than most ...
21
votes
1answer
658 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 ...
36
votes
1answer
494 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 ...
20
votes
6answers
2k 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 ...
21
votes
2answers
473 views

Rotate a diamond tiling

Any regular hexagon can be tiled with diamonds, for instance like so (stolen from this question): ...
10
votes
2answers
602 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 ...
19
votes
2answers
4k views

Rotate a Chinese checkerboard

A Chinese checkerboard looks like this (based on this question, but this time it has a fixed size): ...
6
votes
2answers
2k views

Coding hex board game

Introduction Hex is a strategy board game played on a hexagonal grid, theoretically of any size and several possible shapes, but traditionally as an 11×11 rhombus. Other popular dimensions are 13×13 ...
17
votes
9answers
839 views

Asymmetrical KOTH: Catch the Cat (Catcher Thread)

Asymmetrical KOTH: Catch the Cat UPDATE: The gist-files are updated (including new submisisons) as the Controller.java did not catch Exceptions (only errors). It does now catch errors and exceptions ...
14
votes
9answers
878 views

Asymmetrical KOTH: Catch the Cat (Cat Thread)

Asymmetrical KOTH: Catch the Cat UPDATE: The gist-files are updated (including new submisisons) as the Controller.java did not catch Exceptions (only errors). It does now catch errors and exceptions ...
21
votes
5answers
1k views

Chinese checkerboard

The game of Chinese checkers is played on a board with spaces in the shape of a six-pointed star: Image from Wikipedia We can create an ASCII-art representation of this board, using ...
15
votes
1answer
970 views

Settlers of Catan - Longest Road!

This is an endgame board of Settlers of Catan: Background: The roads (the long stick pieces) and the settlements (and cities) are rendered by the little huts. We encode the placement of these pieces ...
13
votes
1answer
351 views

Save the Geese from Extinction

The species of geese known as Alex A are known for residing in triangular grids consisting of 64 cells: (Picture taken from this unrelated Project Euler problem.) We'll label each cell with the ...
39
votes
13answers
4k views

Me Want Honeycomb

Write the shortest program that prints this ASCII art section of a hexagonal tiling or honeycomb: ...
22
votes
2answers
506 views

Water held in a hexagonal rod scuplture

I have bunch of hexagonal rods glued together into an odd sculpture. The rods are 1 to 99 centimetres (cm) long and 1 square cm in cross-section area. All rods are glued on a hexagonal face to at ...
16
votes
2answers
982 views

Score a game of Kingdom Builder

I want to try a new form of code golf here. Similar to bonuses, not all parts of the challenge have to be completed, but each answer has to implement a subset of certain size (and there is a core that ...
44
votes
30answers
3k views

Draw a bowling formation

Your goal is to display ASCII art of a formation in ten-pin bowling where only some of the pins remain. Fewest bytes wins. The tens pins are in a triangular formation: ...
12
votes
2answers
893 views

Chinese Checkers longest move

In Chinese Checkers, a piece can move by hopping over any other piece, or by making a sequence of such hops. Your task is to find the longest possible sequence of hops. Input A sequence of 121 ...
22
votes
4answers
4k views

Solve Aristotle's Number Problem

Aristotle's number puzzle is the challenge of populating each of 19 cells in a hexagonal grid with a unique integer between 1 and 19 such that the total along every axis is 38. You can picture the ...
5
votes
4answers
13k views

Solve the Magic Hexagon [closed]

A magic hexagon is a hexagon where every row and every diagonal add up to the same value. In this case the value is 38. Each number from 1 to 19 must be used exactly once. This image shows a solution ...
8
votes
3answers
2k views

Solve the 14-Pegs puzzle

Introduction A common puzzle involves a triangular board with 15 holes for tees/pegs as shown in the image below: Starting with all the pegs in the board except for a hole at the top, the point of ...