All Questions

Filter by
Sorted by
Tagged with
19
votes
7answers
3k views

Hello, Toroidal Earth!

Your task is to create a program that outputs the string: Hello, Toroidal Earth! with an optional trailing newline. Additionally if I remove the first line1 of ...
18
votes
16answers
2k views

Make me a shape

The game shapez.io has a huge variety of shapes you can produce, such as: Each shape has a unique short code, for example the above is CrWbScRu. This means, going ...
24
votes
31answers
3k views

"-rot" transform

Background -rot transform (read as "minus-rot transform") is a sequence transformation I just invented. This transform is done by viewing the sequence as a stack in Forth or Factor (first ...
19
votes
19answers
2k views

Hunt for discount

Story My local pizza delivery introduced new discount. You get 50% discount from every second item on your order. But being greedy capitalists, they forgot to mention that they will rearrange items ...
21
votes
8answers
5k views

Make a Hello World using as many bytes as possible

Write a program that outputs the exact string: jan ale o, toki! ("Hello, world" but in toki pona to prevent builtins.) with an optional trailing newline. ...
27
votes
10answers
4k views

Distances between keys on a QWERTY keyboard

Inspired by this video by Matt Parker The distances between the letter keys of a QWERTY keyboard are somewhat standardised. The keys are square and both the horizontal and vertical spacing are 19.05mm ...
-5
votes
3answers
338 views

Make a GUI window in any language using minimum "different characters" [closed]

I want you to make a gui window like this: * if you're thinking, the [quit] button closes the window in any language using minimum "different" characters.. AND remember that the gui window ...
9
votes
4answers
306 views

Parse Ternary Lambda Calculus for correctness

Wheat Wizard has once tried to come up with a parsing problem unsuitable for regex, but it failed due to Anders Kaseorg's Perl regex answer. This is the second attempt. Now that we know that Perl ...
15
votes
4answers
650 views

Could you massage this stack for me?

Forth is one of the few non-esoteric stack-based languages. For this challenge, we will use a small subset of Forth, which simply executes a sequence of words in a linear fashion — without any ...
25
votes
12answers
2k views

Rows of the Collatz tree

Consider a binary tree built the following way: The root node is \$1\$ For a given node \$n\$: If \$n\$ is odd, its only child is \$2n\$ If \$n\$ is even, one of its children is \$2n\$. If \$\frac {...
10
votes
8answers
904 views

Boustrophedon transform

Related: Boustrophedonise, Output the Euler Numbers (Maybe a new golfing opportunity?) Background Boustrophedon transform (OEIS Wiki) is a kind of transformation on integer sequences. Given a sequence ...
2
votes
0answers
123 views

Tips for Golfing the Lambda Calculus & Friends

This includes tips for all related derivatives, as coding in these langs often primarily consists of writing the function in the lambda calculus and then compiling it down at the end. Among others, ...
29
votes
5answers
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: ...
11
votes
2answers
753 views

SKI calculus golf: Hello, World!

Background SKI combinator calculus, or simply SKI calculus, is a system similar to lambda calculus, except that SKI calculus uses a small set of combinators, namely ...
21
votes
5answers
998 views

Parse a lambda for correctness

The goal of this challenge is to fill a niche that is mostly lacking on this site. In my observations there most parsing verification challenges fall into two categories: Super easy parsing. This ...
23
votes
17answers
2k views

Show me the trajectory

Given a list of integers find the "trajectory" that results from indefinitely moving the instructed steps to the right (left if negative), wrapping if necessary, starting at the first ...
9
votes
7answers
712 views

Reverse cadaddadadaddddaddddddr [closed]

The Lisp language has a family of functions car, cdr, cadr, etc for accessing arrays. For ...
10
votes
3answers
283 views

How many dominoes can you fit here?

Much harder than Can this pattern be made with dominoes? Challenge A grid of width \$w\$ and height \$h\$ is given, filled with 1s and 0s. You can place a domino somewhere on the grid only if both ...
14
votes
1answer
308 views

Build the widest unsupported bridge with nothing but frictionless blocks

In this challenge you must write a computer program that creates a stack of a thousand identical \$1 \times 1\$ frictionless homogeneous blocks such that each block is supported and the stack is ...
11
votes
2answers
469 views

Is this an interval graph?

Background An interval graph (Wikipedia, MathWorld, GraphClasses) is an undirected graph derived from a set of intervals on a line. Each vertex represents an interval, and an edge is present between ...
21
votes
13answers
2k views

Emanresu numbers

My userid is 100664. In binary this is 11000100100111000. An interesting property of this number is that it can be created entirely by concatenating strings which ...
21
votes
19answers
4k views

Generalized FizzBuzz

Task FizzBuzz, but instead of 3 and 5, you'll take the numbers and corresponding strings as input. You can assume all inputted numbers are coprime (and \$\ge 2\$). You'll receive one or more numbers, ...
14
votes
3answers
217 views

Bijection between \$ \mathbb N \$ and at-most-\$n\$-ary trees

Background Related: a golflang theory I posted in TNB a while ago At-most-\$n\$-ary trees are rooted trees where each internal node has between 1 and \$n\$ children (inclusive). Two trees are ...
22
votes
8answers
4k views

Obfuscate my ><>

><>, or Fish, is a two-dimensional esoteric programming language where the instruction pointer (IP) toroidally moves around the codebox, wrapping when it hits an edge. ><> has four ...
23
votes
26answers
1k views

Split into sublists of specified sizes

05AB1E has the £ builtin which, given a list of integers b and a string s, splits ...
12
votes
6answers
879 views

Eric Angelini's "1995" puzzle

The following puzzle was invented by Eric Angelini in September 2007. As mentioned in A131744 : the sequence is defined by the property that if one writes the English names for the entries, replaces ...
15
votes
6answers
497 views

Counting maximal domino placements

Background A maximal domino placement (MDP) on a rectangular grid is a non-overlapping placement of zero or more dominoes, so that no more dominoes can be added without overlapping some existing ...
5
votes
2answers
297 views

Give the minimum Levenshtein distance to a string that matches the regex

Your task, at the moment that you choose to accept it, is to write a program that, when given a string and a PCRE-regex, calculates the minimum Levenshtein distance to another string that matches the ...
13
votes
1answer
911 views

How to golf a fork in Haskell?

I'm trying to make a pointfree function f that can act like APL's dyadic forks/Husk's §, so ...
7
votes
33answers
2k views

Custom Rows of Smileys Triangle

This problem is inspired from shinh's problem. Given an input of positive integer \$n\$, output a smiley triangle (see below) with \$n\$ rows. Detailed rules Can be either a function or a full ...
5
votes
4answers
151 views

Ordered, linear, affine, or relevant?

Background Supplementary reading 1, Supplementary reading 2 Linear lambda calculus is a limited form of lambda calculus, where every bound variable must be used exactly once. For example, ...
18
votes
19answers
5k views

What's my PIN number?

My PIN number is 1077, but that's too difficult to remember. I know from muscle memory that it's a digit, followed by a different digit, then followed by two of the same digit, which is different to ...
20
votes
18answers
4k views

Build me a room

Related A room, in the context of this challenge, is a multidimensional array where the elements on the "outside" are 1, to represent the walls, and all ...
0
votes
0answers
248 views

FreeCell stack moving

This question is about moving stacks around in the card game FreeCell, but here it will be presented more abstractly. Given three integers \$0\le n,m<10000,0<k<10000\$. There are \$m+2\$ ...
11
votes
4answers
531 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: ...
17
votes
4answers
532 views

Calculate the integer square root of a matrix

Let \$A\$ be a square matrix that is at least \$2 \times 2\$ where each element is an integer. \$A^2 = A \times A\$ will then have the same dimensions as \$A\$, and will have integer elements. For ...
8
votes
1answer
242 views

Flatten a parabola keeping the distances between points along the curve constant

Background Math SE's HNQ How to straighten a parabola? has 4,000+ views, ~60 up votes, 16 bookmarks and six answers so far and has a related companion HNQ in Mathematica SE How to straighten a curve? ...
21
votes
4answers
2k views

A quantum quine

Your challenge is to write a program that is a quine, meaning it prints out its own source code. For at least one individual character, when it is removed from the program's source, a single different ...
6
votes
2answers
703 views

How to ignore first user input in Python 3

I have 2 inputs: 1 single number and some numbers separated by whitespace: 1 1 2 3 4 5 I want to loop over the second input, and I don't need the first input. I ...
4
votes
1answer
165 views

Calculate the (n x "super")factorial [duplicate]

Introduction Factorials are one of the most frequently used examples to show how a programming language works. A factorial, denoted \$n!\$, is \$1⋅2⋅3⋅…⋅(n-2)⋅(n-1)⋅n\$. There is also the ...
22
votes
11answers
1k views

Enlarge ASCII art, Mark II

Related Given a piece of ascii art and a factor to enlarge it by, which will always be an odd number >1, replace each character with the corresponding ascii-art, resized to fit on a grid the size ...
5
votes
5answers
205 views

Potential nonzero entries in an irregular sequence

Background A338268 is a sequence related to a challenge by Peter Kagey. It defines a two-parameter function \$T(n,k)\$, which counts the number of integer sequences \$b_1, \cdots, b_t\$ where \$b_1 + \...
17
votes
14answers
1k views

Unfold a list using a function

Task Haskell's and Scala's standard libraries have an unfold function that builds a list from an initial state s and a function <...
8
votes
4answers
261 views

The Roly-Poly, Square-Wheeled Quine

Code-Golf caddy Eddie Brackets was getting tired of quine challenges, which appeared to be much too easy for the grand poobahs. He has this idea to spice up things and is sending quines to the car ...
12
votes
1answer
284 views

We all know how to SKI, but can you BCKW?

Background Lambda calculus is a model of computation using lambda terms. A variable \$x\$ is a lambda term. If \$E\$ is a lambda term, the lambda abstraction \$\lambda x. E\$ is a lambda term. If \$...
14
votes
12answers
2k views

How many Sets are there?

This is similar in concept to this challenge, but that is pretty restrictive on input and output and I think opening up these restrictions would lead to a completely different set of solutions that ...
8
votes
5answers
257 views

Will Alice win in this Stick Bomber game?

Background Stick Bomber is a two-player game I just made up. Initially, some sticks are placed in one or more groups, and the sticks in each group are laid out in a straight line. So a configuration ...
6
votes
6answers
486 views

Group binary shapes together

Consider the following binary matrix: $$\begin{matrix} 1 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 1 \end{matrix}$$ The (1-indexed) co-ordinates of the \$1\$s here are \$(1,1), (1,3), (2,...
29
votes
6answers
4k views

I'm a lizard, cut here!

Write an \$n\$-bytes program \$AB\$ such that: it outputs an integer \$x,\ 0\lt x\lt n\$; both its \$x\$-byte prefix \$A\$ and \$(n-x)\$-byte suffix \$B\$, when run as programs, output \$AB\$. \$A, ...
15
votes
19answers
1k views

Compare positions of integers in this sequence

A001057 is one way to represent an integer as a natural number. It lists them according to the following pattern: 0, 1, -1, 2, -2, 3, -3, 4, -4, ... In this ...

15 30 50 per page