All Questions

Filter by
Sorted by
Tagged with
14
votes
1answer
955 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 ...
6
votes
4answers
166 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 ...
21
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
262 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\$ ...
12
votes
4answers
553 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: ...
18
votes
4answers
557 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 ...
9
votes
1answer
252 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
976 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
193 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
215 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 + \...
18
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 <...
9
votes
4answers
283 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 ...
17
votes
2answers
436 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
278 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
498 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,...
32
votes
7answers
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 ...
8
votes
0answers
299 views

Chess Squad March

Find the moves that bring a chess squad to a given destination. You control a chess squad consisting of a king and several other pieces, on a larger chess board. Your army is placed so that no piece ...
12
votes
22answers
2k views

Park, Lake, Santa Fe [closed]

Given a long multi-sentence string, the goal is the count the occurrences of the following words: park, lake, ...
3
votes
2answers
192 views

A Suitable Mission — The Professor's Revenge

Summer Klerance turned in her term assignment for this challenge. Her professor was miffed (but also amused) when he overheard a disgruntled classmate of Summer's saying she got her answers by ...
14
votes
27answers
3k views

Make an array of random 128 bit integers

Given an input value \$n\$, construct an array of \$n\$ random 128 bit (unsigned) integers. The integers should be uniformly random. Your code can use any in built random number generation function ...
10
votes
32answers
1k views

Index and return 3 characters

The challenge is simple: Read 3 letters from a system input¹ and convert them to numbers (A-1, B-2, C-3...Z-26)². Print each of those numbers in the order the ...
17
votes
5answers
1k views

Are you a probabilist or a physicist?

Hermite polynomials refer to two sequences of polynomials: The "probabilist's Hermite polynomials", given by $${He}_n(x) = (-1)^n e ^ \frac {x^2} 2 \frac {d^n} {dx^n} e ^ {-\frac {x^2} 2}$$ ...
19
votes
5answers
821 views

What if function application was right-associative?

Background In Haskell and many other functional languages, function application f(x) is simply written as f x. Also, this form ...
17
votes
14answers
2k views

King of the Hill: Nose Poker - An ogre game for ogres

Links Chat room The official game report Github repo - In case of bugs to report Here's the official score table: ...
17
votes
3answers
716 views

Sliding Dice in a Dish

We have 3 dice in a square dish. The dish is 8 units wide and tall and each die is 3 units wide and tall. The dice are facing up each with a different number on their top face. ...
9
votes
20answers
2k views

Third Stirling numbers of the second kind

\$\left\{ n \atop k \right\}\$ or \$S(n, k)\$ is a way of referring to the Stirling numbers of the second kind, the number of ways to partition a set of \$n\$ items into \$k\$ non-empty subsets. For ...
8
votes
4answers
315 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. ...
19
votes
7answers
2k views

Is this a Jordan matrix?

Background A Jordan matrix is a block-diagonal matrix where each block on the diagonal has the structure of $$ \begin{bmatrix} \lambda & 1 & 0 & \cdots & 0 \\ 0 &...
8
votes
7answers
441 views

A Suitable Mission

Summer Klerance, a senior in college, is what her teachers refer to as GBL*. Students in her probability class have been assigned individual problems to work on and turn in as part of their final ...
22
votes
22answers
3k views

Longest Zero Sum Sub-array

Given an array of integers. Find out its longest sub-array (contiguous subsequence) whose sum is 0. The sub-array for output may be an empty array. Input Input an array of integers. Output Output the ...
25
votes
7answers
2k views

Happy Birthday... caird coinheringaahing? ChartZ Belatedly?

When this question was posted, it was caird coinheringaahing's birthday! (source: 1, 2, 3, 4) (It was also World Emoji Day.) As a bit of some CGCC lore, caird's name came from a Jelly answer by Dennis ...
6
votes
6answers
377 views

Blinking Lighthouses – Founder's Day Upgrade

To celebrate the island's next Founder's Day, colored filters (fuchsia, chartreuse, and aquamarine*) have been installed in every lighthouse. All lighthouses begin operation with their fuchsia filter,...
8
votes
3answers
425 views

Possible numbers on a broken screen

A screen consisted of some LED segments like such: _ _ _ _ _ |_|_|..._|_|_| |_|_| _|_|_| However, some of the LEDs are broken, and it's possible that only ...
16
votes
8answers
753 views

Polyagony layout (mode 3/3,6)

Background Polyagony is a family of hypothetical esolangs where the source code is laid out on a specifically shaped board before running it. It's similar to Hexagony, but various uniform tilings can ...
20
votes
5answers
2k views

KEYBOARD FOR MONKE!

Flavortext So...this is awkward. It seems I accidentally turned into a monkey last night after eating one too many banana sundaes. This has made many things inconvenient, especially typing. You see, ...
10
votes
42answers
2k views

Which character to change (Robbers)

Cops thread Robbers, your task is to crack a cops answer. Reveal the character that should be changed and what it should be changed to too. Please notify the cop if you cracked their challenge. The ...
18
votes
44answers
3k views

Which character to change (Cops)

Robbers Thread Cops, your task is to chose a program that prints a string (you can choose). Although, if you change 1 character in your code, it should print another string. But there's a twist: You ...
5
votes
3answers
150 views

Is this an ordinal transform? [duplicate]

Related: What's my telephone number? which asks to calculate the terms of A000085, the number of possible ordinal transforms of length n. Background Ordinal transform is a transformation on an integer ...
15
votes
18answers
3k views

It almost works (Robbers' Thread)

Cops' Thread Your challenge is to find an uncracked, unsafe cop on the cops thread, and find an input value for which their code does not do as specified by the challenge. You must use values within ...
27
votes
21answers
4k views

It almost works (Cops' Thread)

Robbers' Thread Your challenge is to find an existing challenge, and implement it in a way such that certain inputs fail. At least one input must not produce the correct output (use the other ...
0
votes
0answers
52 views

Simple Maze Generator [duplicate]

Introduction Some time ago I found interesting one-liner for C64 and book (300 pages!) only about this programm 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 which ...
19
votes
21answers
2k views

Implement the Torian

The Torian, \$x!x\$, of a non-negative integer \$x\$ can be recursively defined as $$ x!0 = x \\ x!n = \prod^x_{i=1} i!(n-1) = 1!(n-1) \times 2!(n-1) \times \cdots \times x!(n-1) $$ The Torian is then ...
8
votes
4answers
186 views

Hamiltonian levencycle of 1-dup permutations

The word "levencycle" is inspired by cyclic levenquine challenge. Definitions A 1-dup permutation of order \$n\$ is some permutation of \$1, \cdots, n\$ plus one duplicate number in the ...
10
votes
7answers
437 views

Splinter metagolf

The language Splinter is an esoteric programming language where data is stored in 'splinters'. There are three different types of syntax: Simple character output: ...

15 30 50 per page
1
3 4
5
6 7
253