The 2024 Developer Survey results are live! See the results

# Tag Info

### Triangular Lattice Points close to the Origin

Python 2, 43 bytes f=lambda n,a=1:n*n<a/3or n*n/a*6-f(n,a+a%3) Try it online! This is black magic. Offering 250 rep for a written-up proof. See Lynn's ...
• 146k

### Snowman Bowling

Snowman 1.0.2, 157 bytes ...
• 71.5k

### Could you make me a hexagon please?

Hexagony + Bash Coreutils, 0+3+8 = 11 Bytes Includes +3 for -g flag and +8 for |tr . \* non-standard invocation (see this meta ...
• 11.7k

### Hexagonal maze time!

Hexagony, 2437 bytes The long-awaited program is here: ...
• 2,317

### Triangular Lattice Points close to the Origin

Haskell, 48 bytes f n=1+6*sum[(mod(i+1)3-1)*div(n^2)i|i<-[1..n^2]] Try it online! Uses xnor's "black magic" formula: f(n)=1+6\sum_{a=0}^\infty \...
• 68.9k

### Triangular Lattice Points close to the Origin

Wolfram Language (Mathematica), 53 51 50 bytes -1 byte thanks to @miles Sum[Boole[x(x+y)+y^2<=#^2],{x,-2#,2#},{y,-2#,2#}]& Try it online! How? Instead of ...
• 13.8k

• 6,276
Accepted

### A spiral sequence

JavaScript (ES6),  267 .. 206  199 bytes Returns an array containing the $N$ first terms of the sequence. ...
• 194k

### Could you make me a hexagon please?

Python 2, 61 bytes i=n=input() while~-n+i:i-=1;j=abs(i);print' '*j+'* '*(2*n+~j) Prints a trailing space at the end of each line. Thanks to Erik the Outgolfer ...
• 146k

### Counting creatures on a hexagonal tiling

JavaScript (Node.js),  578 ... 433  431 bytes ...
• 194k

### HexaGolf: Wordagons

Python 2, 83 bytes s=input() l=len(s) while 1:l-=1;y=abs(l);print' '*y+' '.join(s[:y:-1]+s[y]*y+s[y:]) Prints the wordagon and then crashes (which only prints to ...
• 68.9k

### Stack the rocks

Ruby, 124 117 112 110 bytes ...
• 26.4k

### HexaRegex: A Tribute to Martin Ender

Retina, 744 bytes Sorry folks, no Hexagony this time... Byte count assumes ISO 8859-1 encoding. ...
• 197k
Accepted

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

JavaScript (ES7),  367 362 359  357 bytes Saved 1 byte thanks to @Shaggy Expects (n)(m). ...
• 194k

### Hexplosive ASCII-art challenge

JavaScript (ES6), 118 117 bytes ...
• 173k

### Could you make me a hexagon please?

Hexagony, 91 87 86 bytes ?{2'*=&~}=&}='P0</0P}|@..;>;'.\};0Q/..\&(<>"-_"&}=\?_&\/8.=-\<><;{M/.(.(/.-{><.{&'/_.\ ...
• 17.3k

### HexaGolf: Rotatagons

Python 2, 160 158 156 148 124 bytes Prepare to be amazed! The resulting text is drawn on a canvas... by a Turtle! :D ...
• 23.4k

### HexaRegex: A Tribute to Martin Ender

Python 3, 990 943 770 709 bytes First answer, yay! EDIT: Golfed adjacency list making. I now use a slightly different formula EDIT 2: Removed unnecessary fluff, golfed a lot more. EDIT 3: ...
• 2,036

### Could you make me a hexagon please?

JavaScript (ES6), 77 81 84 @Upvoters: don't miss the answer by @ETHproductions, that is 76 bytes Edit Revised after change in spec, trailing space allowed Just for the hat ... hey! No hat? ...
• 32.2k

### Halting Problem for Simplified Hexagony

APL (Dyalog Unicode), 616 bytesSBCS ...
• 77.8k

### Could you make me a hexagon please?

JavaScript (ES6), 77 76 bytes g=(n,s= *+' *'.repeat(n*2-2),c=s,q=c.replace('*',''))=>--n?g(n,q+s+q,q):s I told myself I wouldn't sleep until I had set a new ...
• 50.1k

### Totally random Catan number distributions

JavaScript (ES6), 162 bytes ...
• 194k
Accepted

### Hexplosive ASCII-art challenge

MATL, 39 37 bytes 4*3-:!G:+o~YRtP*!tPw4LY)vtI5&lZ+47+*c Try it online! Or verify all test cases. Explanation I get to use convolution again! Consider input <...
• 105k

### Could you make me a hexagon please?

C, 91 89 80 74 bytes w,y;f(s){for(y=-s;++y<s;)for(w=printf("\n%*s",y,"");++w<s*printf(" *"););} I pretty much tweaked around to ...
• 1,187

### Working on my Knight moves

JavaScript (ES6), 184 bytes Takes the file F as a character and the rank R as an integer in currying syntax ...
• 194k
Accepted

### Hexagonal Triangles!

Charcoal, 62 43 39 bytes ＮβＦ³«Ｆ⁻β‹ι²« / \¶| |¶ \ /Ｍ×²ι↑¿⁻¹ιＭ⁶← Try it online! Edit: Saved some bytes thanks to @ASCII-only (not sure exactly how many as I also ...
• 173k

### ASCII Rubik's Cube

Charcoal, 28 23 bytes Ｆ³⁺⁺×\_³×\/⁻³ι¶ ‖Ｍ↑×_ ³ Try it online! Link is to verbose version of code. Not very Charcoal-y I know. I didn't realise that ...
• 173k

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

Scala 3, 526...358 357 bytes ...
• 357
Vim, 92 bytes :se ri|s/./ &/g ⓋCⓇ"Ⓓ␛\$vpmlmrqqYpi ␛ljxxhmlylvrjlmr:s/\%V$$.$$./Ⓡ" /g @qq@qVdy2G:g/^/m0 Gp Circled letters represent Control + letter; ␛ is ...