All Questions

Filter by
Sorted by
Tagged with
3
votes
0answers
39 views

Can this Scottish village have a wedding?

This is the exact same question I asked earlier, but without the annoying Cyrillic factor which many found superfluous. I hope this is a better puzzle! The quaint hamlet of North Codetown in the ...
12
votes
8answers
507 views

Substitute Unprintable ASCII Characters

Sandbox Have y'all ever written an answer with unprintable ASCII characters in it and wished that there was an easy way to represent those characters in a printable way? Well, that's why the Control ...
8
votes
0answers
124 views

Convert Complex Chinese Numbers into Arabic Numbers

Your task is to convert Chinese numerals into Arabic numerals. A problem similar to Convert Chinese numbers, however, more complex. Also, answers given there mostly don't satisfy all the conditions. ...
5
votes
10answers
641 views

Euclidean Distance Between Two Matrices

Your task is to write the shortest algorithm in a language of your choosing that accomplishes the following: Given two matrices it must return the euclidean distance matrix. The euclidean distance ...
9
votes
23answers
941 views

N-Dimensional Cartesian Product

Introduction The Cartesian product of two lists is calculated by iterating over every element in the first and second list and outputting points. This is not a very good definition, so here are some ...
24
votes
1answer
343 views

Can this village have a wedding?

The quaint hamlet of Кодгольф in the Russian far east has a problem: their population is low (below 66), and no new people have arrived for years. Moreover, after centuries of near-isolation, just ...
23
votes
32answers
2k views

Days in indexed month

This simple challenge is very similar to this one: How many days in a month? The only difference is you yield the number of days in a month given the index of the month instead of its name. The ...
0
votes
0answers
200 views

Reconstruct a video where the frames' pixels have been shuffled [sandboxed] [on hold]

Please give feedback in the sandbox version if you want to improve this question. Thanks! Given a video where all the pixels of every frame have been scrambled with some image scrambling function T(...
21
votes
14answers
2k views

ASCII texturing

Write a function or a full program that applies an ASCII texture to a 2d shape. Inputs: shape, texture, dimensions(optionally). Both Shape and Texture can be given by any convenient method (2d ...
16
votes
14answers
2k views

Unique magic triplets

Description Your input is a list of integers \$[a_1, \dots, a_n]\$. A magic triplet is a triplet \$(a_i, a_j, a_k)\$ of values from this list, such that the indices \$\{i, j, k\}\$ are all distinct,...
0
votes
0answers
97 views

This one might be a bit unique [on hold]

For those who have spent hours mastering the art of TI-84 programming, I challenge you to make a 24 solver (given 4 inputs which are integers, use +, -, *, /, and () to create 24) on a TI-84. Of ...
22
votes
31answers
1k views

Sort and Table a Sentence by Word Lengths

In as few bytes as possible, sort the input, a delimited string OR list/vector/array of words, words contain printable ASCII except space (ASCII values 33-126) into a numbered list, table, or ...
10
votes
2answers
282 views
+100

Exploding Primes

At the time of writing this puzzle, there are soon to be 269 puzzles related to primes. To celebrate/mourn this event (269 is prime), this challenge will be about exploding primes. In preparation for ...
7
votes
3answers
376 views
+50

A guess the word game

A guess the word game The agreed dictionary. All words are 6 letters long with all letters distinct Rules: This is a game of two players and the task will be to implement Player 2. Player 1 ...
2
votes
0answers
57 views

Counting syllables [duplicate]

Challenge Write code that, given an English word, outputs the number of syllables it has. Scoring will be determined by a combination of code length and accuracy. Rules The accuracy of the ...
15
votes
5answers
3k views

Format a Swedish phone number

In some parts of the world, phone numbers are fixed-length, apparently. That sounds boring, though. For this challenge, your task is to take the digits of a what is presumed to be a valid phone ...
10
votes
9answers
840 views

Area of diagonal-folded regular polygon

I have a piece of paper whose shape is a regular n-gon with side length 1. Then I fold it through some of its diagonals. What is ...
16
votes
22answers
3k views

Size Does Matter (at least referring to bottles)

Introduction I have an even number of bottles, all of different sizes. Unfortunately, I only know the size of the smallest bottle: 300ml. I also know the following: Half of the bottles are twice ...
45
votes
14answers
5k views

In Flanders Fields

Today is November 11th, which for many regions is Remembrance Day. If you don't know anything about the history or context of Remembrance Day, you can read about it in the wiki page, but it's not ...
29
votes
4answers
1k views

Expand a recursive pattern

Given a description of the base state of a recursive ASCII pattern, output an expanded state somewhere along the recursion steps. More specifically: Let the following be an example: ...
25
votes
11answers
3k views

20 cards with no Set

Background Set is a card game. The deck consists of 81 unique cards that vary in four features: number of shapes (one, two, or three), shape (diamond, squiggle, oval), shading (solid, striped, or ...
1
vote
5answers
219 views

Proportion of strings with ascending letters [closed]

Challenge Construct n strings, each with three distinct letters, chosen randomly with equal probability. Print the proportion ...
-2
votes
1answer
114 views

Symbol Search Deleter [rephrased] [closed]

Your challenge is to parse nonsensical text and output a "congruous phrase" - which I shall define here to be text with any contiguous characters in between, and including, a given set of like symbols ...
1
vote
1answer
298 views

Draw a fuzzy grid

Print the ASCII version of a random grid. ...
0
votes
2answers
161 views

Longest pristine(ish) codepoint run

Your challenge is to create the longest run of characters with incrementing Unicode codepoints in a pristine program as you can. To keep things simple, I'll abridge the definition for this challenge ...
13
votes
18answers
1k views

Horizontally mirror a brainflak program

Your task is to write a program or function which takes a pure brainflak program as input (assume it contains only balanced ()[]{}<>), and output a visually ...
14
votes
54answers
3k views

Average Two Letters

Introduction Every letter in the English alphabet can be represented as an ASCII code. For example, a is 97, and ...
-7
votes
0answers
151 views

HTML & inline CSS ONLY! [closed]

This is a challenge that has never been executed before. In this challenge you are ONLY allowed to use HTML and limited CSS. ...
0
votes
0answers
63 views

Making Fibonacci Cry [duplicate]

Introduction The Fibonacci sequence is a mathematical sequence in which each term is the sum of the \$2\$ terms before it; the first two terms are \$0\$ and \$1\$. The first few terms are \$0, 1, 1, ...
18
votes
39answers
5k views

Am I being run backwards?

Your task is to write a program, function, or snippet that will output one value if run forward, and another if run backward. The program must run without errors. The output can be any two distinct ...
0
votes
3answers
112 views

Currency exchange [duplicate]

You are starting up a cryptocurrency exchange website which supports conversion from USD to two currencies, foo-coin and bar-coin. Write a program that takes the exchange rate for each coin to USD as ...
9
votes
8answers
329 views

1D Shikaku Validation

Shikaku is a 2D puzzle. The basic rundown of it is that a rectangular grid has some numbers in it, and you want to partition the grid into rectangular components such that each component contains ...
8
votes
13answers
345 views

Print all the ways to aquire specific number using only specific numbers

Let's say we have some arbitrary number: For example 25. We also have some "tokens" (poker chips, money, something similar) with different values. Values of tokens are ...
29
votes
12answers
2k views

What is my volume?

Given an input integer, output the volume corresponding to the value. The value will always be in the range \$[0,100]\$. Examples If the input \$=0\$: ...
10
votes
7answers
1k views

Extract all keys from an object (json)

Description Given an object (json), write code to extract all the keys from it. This is a question that I really wanted to ask everybody for a long time ago but I did not have time to write it up. It ...
13
votes
13answers
1k views

Is it rectilinear?

Today's challenge: Given an ordered list of at least 3 unique integer 2D points forming a polygon, determine if the resulting polygon is Rectilinear. A polygon is rectilinear if every interior ...
27
votes
12answers
3k views

Identify the Eeveelutions

Gah! It's a shame that Pokémon Sword and Shield won't introduce a new eeveelution. Let's mourn them with a code golf. The objective is to, when given a type name as the input, output the name of the ...
-5
votes
2answers
204 views

Fastest N times Hello World (Java/C/ C++) [closed]

Not a new one: Input N, being n, 0 ≤ n ≤ 5. Output N times "Hello World." Example: Input 3 Output Hello World. Hello World. Hello World. These 2 are my ...
13
votes
11answers
1k views

Spanning tree of a rectangular grid

Background A spanning tree (Wikipedia) of an undirected graph is a subgraph that is a tree which includes all of the vertices of the original graph. The following is an example of a spanning tree of ...
13
votes
22answers
4k views

Making Sandwiches

Introduction Bob runs a deli. His deli serves sandwiches to its customers. However, it is a bit unusual. At Bob's deli, instead of telling Bob what they want, customers show Bob an ASCII art drawing ...
0
votes
0answers
176 views

Return the maximum value in the final Array [closed]

Return the maximum value in the final List In this challenge, start with an array initialized to zeros with indices starting at 1 and a series of operations to perform on segments of the list. Each ...
24
votes
17answers
2k views

Implement the Max-Pooling operation from Convolutional Neural Networks

In convolutional neural networks, one of the main types of layers usually implemented is called the Pooling Layer. Sometimes, the input image is big (and therefore time consuming especially if you ...
14
votes
1answer
335 views
+50

Counting symmetric grid chains

Notation and definitions Let \$[n] = \{1, 2, ..., n\}\$ denote the set of the first \$n\$ positive integers. A polygonal chain is a collection of connected line segments. The corner set of a ...
18
votes
16answers
3k views

Check the validity of a 10-digit telephone number

Your task is to write a program or function that checks if a string is a valid phone number. Given a string (or list of characters/codepoints) input, you will output a truthy value if the input is a ...
26
votes
17answers
4k views

Fermat's Last Theorem, mod n

Fermat's Last Theorem, mod n It is a well known fact that for all integers \$p>2\$, there exist no integers \$x, y, z>0\$ such that \$x^p+y^p=z^p\$. However, this statement is not true in ...
16
votes
21answers
6k views

Pi to the power y, for small y's

Input This task takes no input. Output Your code should compute and print (or return) \$\pi^y\$ for all \$y = \frac11, \frac12, \frac13, \frac14, \frac15, \frac16, \frac17, \frac18, \frac19, \frac1{...
19
votes
2answers
1k views

Golf Lathe Machine

You probably know what a Turing Machine is but do you know what is a Turning Machine (lathe)? Ok you already know.. and what about a Golf Turning Machine ?? Ok I tell you.. A Golf Turning Machine is ...
10
votes
4answers
1k views

How compactly can your language perform accurate numerical integration?

WARNING: This challenge may need 128 bit floats.1 The task is to perform numerical integration. Consider the following three functions. \$ f(x) = cx^{c - 1}e^{-x^c} \$ \$ g_1(x) = 0.5e^{-x} \$ \$...
4
votes
1answer
248 views

How can I golf this JavaScript code, if at all?

I have some JavaScript code in a <script> HTML tag I'd like to golf, while still remaining in the tag. How can I golf that code, if at all? Here's the code: <...
1
vote
1answer
134 views

Minimum number of changes required [closed]

Given an array where each number represent a color. After iterating each item in the array (for each item in the iteration the pointer can also point to the second-item-to-the-right), and the two ...

15 30 50 per page