All Questions

Filter by
Sorted by
Tagged with
2
votes
0answers
16 views

Counting syllables

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 ...
9
votes
4answers
419 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
7answers
294 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 ...
15
votes
21answers
1k 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 ...
38
votes
14answers
3k 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
2k 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
214 views

Proportion of strings with ascending letters [on hold]

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

Symbol Search Deleter [rephrased] [on hold]

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
269 views

Draw a fuzzy grid

Print the ASCII version of a random grid. ...
0
votes
2answers
142 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
52answers
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 ...
-8
votes
0answers
132 views

HTML & inline CSS ONLY! [on hold]

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
60 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, ...
17
votes
38answers
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
110 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
313 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
323 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
11answers
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 ...
26
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
191 views

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

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 ...
-1
votes
0answers
58 views

Generate data buffer to zero the CRC check result [closed]

Given this checksum calculation function in C++ ...
0
votes
0answers
63 views

How to calculate the “cross join” of permutations faster? R [closed]

I'm writing some scripts in R and I'd like this section faster, in R. But feel free to write your code or algorithm using other language, I could get ideas to convert it to R. I have a data.table ...
0
votes
0answers
171 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 ...
23
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 ...
13
votes
0answers
237 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 ...
24
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 ...
15
votes
22answers
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
241 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
132 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 ...
9
votes
23answers
2k views

Max of the reversed of two numbers

Given two real numbers (postive or negative) in the limits of float pointing number data types, i.e., (\$-3.4e38\$ to \$3.4e38\$) not inclusive, you should output the max of the two reversed numbers. ...
0
votes
20answers
411 views

Quine in Bytes, not Characters [duplicate]

Introduction A quine is a program that takes no input and produces a copy of its own source code as output. Writing a quine is a standard test of a programming language. Most quines operate using ...
13
votes
6answers
389 views

Roman Numeral Counting

Roman numerals can be (mostly) written in a one column format, because each letter intersects the top and the bottom of the line. For example: I, or 1 intersects ...
13
votes
10answers
668 views

Reach the number in minimum steps

In this challenge, you are given a number x. You have to find the minimum number of steps required to reach x from 1. At a particular point, you have two choices: 1) Increment the number by 1. 2) ...
35
votes
10answers
3k views

Interpret numbers very literally

To interpret a positive integer very literally, write it in English words (without "and"), replace hyphens with spaces, replace each resulting word with its number value, and concatenate the results ...
9
votes
3answers
333 views

Translate a simple sentence from Toki Pona

Toki Pona is a linguist's code golf: A minimalist language with a vocabulary of around 120 words. Because of this, it has very few grammatical irregularities found in other languages, making it ideal ...
7
votes
7answers
494 views

Is this a valid input for this hardware?

The (slightly harder, but still easy) sequel of Generate input for this hardware. Background I have a hardware that has a 32-bit input register. The register has the following characteristics: The ...
0
votes
1answer
115 views

Shooting gallery Puzzle!

Have you been shooting gallery? We are recently. In our shooting gallery cans and aluminum cans from under various drinks hang and stand. More precisely, they hung and stood. From our shots, banks ...
14
votes
8answers
753 views

ASCII Pumpkin Carving [duplicate]

Today is Halloween and it's time to carve some pumpkins! & ((^.^)) Given an input integer, string, list of integers, etc., output the corresponding ...
3
votes
5answers
270 views

Trick or Treating

Introduction Little Jimmy is going trick or treating. He lives in an odd neighborhood: some houses give out candy, and some give out toothbrushes. Now, Jimmy does not want to get too many ...
6
votes
1answer
392 views
+100

Follow the Path, but is it valid?

Follow the Path I got directions to my friend's house, but it looks like his map might have some mistakes. He's expecting me soon, so I need some short code to figure out if I can get there. The ...
43
votes
24answers
9k views

Cheat at Rock-Paper-Scissors-Lizard-Spock

When playing Rock-Paper-Scissors-Lizard-Spock, your robot reflexes let you see your opponent's throw before they make it. You just need to choose a throw that beats theirs, in as few bytes as possible ...

15 30 50 per page